From 4656cbd57352c79a0d138a2a76cd071acd45e816 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sat, 12 Oct 2024 19:52:17 -0700 Subject: [PATCH] update slow-termination test This requires an update each time we add kvStore entries, because it counts them precisely as we delete them all. --- .../slow-termination/slow-termination.test.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/SwingSet/test/vat-admin/slow-termination/slow-termination.test.js b/packages/SwingSet/test/vat-admin/slow-termination/slow-termination.test.js index bdf050d75a96..2e5b4909fb7c 100644 --- a/packages/SwingSet/test/vat-admin/slow-termination/slow-termination.test.js +++ b/packages/SwingSet/test/vat-admin/slow-termination/slow-termination.test.js @@ -152,9 +152,9 @@ async function doSlowTerminate(t, mode) { .get(vatID); // 20*2 for imports, 21*2 for exports, 20*2 for promises, 20*1 for - // vatstore = 142. Plus 21 for the usual liveslots stuff, and 6 for + // vatstore = 142. Plus 21 for the usual liveslots stuff, and 7 for // kernel stuff like vNN.source/options - const initialKVCount = 169; + const initialKVCount = 170; t.is(remainingKV().length, initialKVCount); t.false(JSON.parse(kvStore.get('vats.terminated')).includes(vatID)); @@ -253,36 +253,36 @@ async function doSlowTerminate(t, mode) { await cleanKV(10, 5); // 5 c-list promises // that finishes the promises, so the next clean will delete the - // first five of our 47 other kv entries (20 vatstore plus 27 - // liveslots overhead + // first five of our 48 other kv entries (20 vatstore plus 28 + // overhead) await cleanKV(5, 5); // 5 other kv - // now there are 42 other kv entries left - t.is(remainingKV().length, 42); + // now there are 43 other kv entries left + t.is(remainingKV().length, 43); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 37); + t.is(remainingKV().length, 38); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 32); + t.is(remainingKV().length, 33); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 27); + t.is(remainingKV().length, 28); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 22); + t.is(remainingKV().length, 23); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 17); + t.is(remainingKV().length, 18); checkTS(); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 12); + t.is(remainingKV().length, 13); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 7); + t.is(remainingKV().length, 8); await cleanKV(5, 5); // 5 other kv - t.is(remainingKV().length, 2); + t.is(remainingKV().length, 3); checkTS(); - // there are two kv left, so this clean will delete those, then 5 of - // the 7 snapshots - await cleanKV(2, 7); // 2 final kv, and 5 snapshots + // there are three kv left, so this clean will delete those, then 5 + // of the 7 snapshots + await cleanKV(3, 8); // 3 final kv, and 5 snapshots t.deepEqual(remainingKV(), []); t.is(kernelStorage.kvStore.get(`${vatID}.options`), undefined); expectedRemainingSnapshots -= 5;