Skip to content

Commit

Permalink
fix(SwingSet): increase default snapshotInitial from 2 to 3
Browse files Browse the repository at this point in the history
The new `initialize-worker` pseudo-delivery counts against our
`snapshotInitial` threshold. So the old threshold of "2" (allowing two
real deliveries to the vat before we make the first snapshot, one for
`startVat`, and another for the usual `startZcf` that our contract
vats do) needs to become "3".

This updates test-state.js to match.

A few tests provide a specific value (usually "2"), and are sensitive
to the exact sequence of deliveries being made (including
`save-snapshot` pseudo-deliveries). These were left alone.

closes #7548
  • Loading branch information
warner committed Apr 30, 2023
1 parent ec3faed commit 1afcfa6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/SwingSet/src/kernel/state/kernelKeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ export default function makeKernelKeeper(kernelStorage, kernelSlog) {
defaultManagerType = 'local',
defaultReapInterval = 1,
relaxDurabilityRules = false,
snapshotInitial = 2,
snapshotInitial = 3,
snapshotInterval = 200,
} = kernelOptions;

Expand Down
4 changes: 2 additions & 2 deletions packages/SwingSet/test/snapshots/test-state.js.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Generated by [AVA](https://avajs.dev).

> initial state
'cd49a1acb9a4a29e2e11db5b1f20583dec0c8e2f42c59ecfeb1210e9a5af2e95'
'a5d302e6743578ccda03ea386abd49de0a3bf4d7dedda2f69585c663806c30bc'

> expected activityhash
'63ca45dd5fd430a01013f8ce504f8dcfd29f5c63c861d98b10bf002ecc6dc93c'
'f5f1f643f6242a73c79b0437dbab222d34642ea5d047f15aaf5551d5903711d3'
Binary file modified packages/SwingSet/test/snapshots/test-state.js.snap
Binary file not shown.
8 changes: 4 additions & 4 deletions packages/SwingSet/test/test-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ test('kernel state', async t => {
['kp.nextID', '40'],
['kernel.defaultManagerType', 'local'],
['kernel.defaultReapInterval', '1'],
['kernel.snapshotInitial', '2'],
['kernel.snapshotInitial', '3'],
['kernel.snapshotInterval', '200'],
['meter.nextID', '1'],
]);
Expand Down Expand Up @@ -233,7 +233,7 @@ test('kernelKeeper vat names', async t => {
['vat.name.Frank', 'v2'],
['kernel.defaultManagerType', 'local'],
['kernel.defaultReapInterval', '1'],
['kernel.snapshotInitial', '2'],
['kernel.snapshotInitial', '3'],
['kernel.snapshotInterval', '200'],
['meter.nextID', '1'],
]);
Expand Down Expand Up @@ -283,7 +283,7 @@ test('kernelKeeper device names', async t => {
['device.name.Frank', 'd8'],
['kernel.defaultManagerType', 'local'],
['kernel.defaultReapInterval', '1'],
['kernel.snapshotInitial', '2'],
['kernel.snapshotInitial', '3'],
['kernel.snapshotInterval', '200'],
['meter.nextID', '1'],
]);
Expand Down Expand Up @@ -465,7 +465,7 @@ test('kernelKeeper promises', async t => {
[`${ko}.refCount`, '1,1'],
['kernel.defaultManagerType', 'local'],
['kernel.defaultReapInterval', '1'],
['kernel.snapshotInitial', '2'],
['kernel.snapshotInitial', '3'],
['kernel.snapshotInterval', '200'],
['meter.nextID', '1'],
]);
Expand Down

0 comments on commit 1afcfa6

Please sign in to comment.