Skip to content

Commit

Permalink
chore(swingset): improve test-transcript
Browse files Browse the repository at this point in the history
Update test-transcript.js to wait for the combined run-queue and GC-actions
queue to drain, now that c.run()/c.step() executes GC actions first. Also
shutdown the controller properly after each call to buildTrace().

This test exhibits odd GC behavior when:

* it lacks the wait for `gcActions.length`
* and uses the default 'local' vat worker
* liveslots calls `gcAndFinalize()` only once

This suggests that our `gcAndFinalize()` is insufficient, at least on
Node.js. See #3240 for more details.
  • Loading branch information
warner committed Jun 2, 2021
1 parent a3a6149 commit c4edf96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/SwingSet/test/test-transcript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { buildVatController, loadBasedir } from '../src/index';

async function buildTrace(c, storage) {
const states = [];
while (c.dump().runQueue.length) {
while (c.dump().runQueue.length && c.dump().gcActions.length) {
states.push(getAllState(storage));
// eslint-disable-next-line no-await-in-loop
await c.step();
}
states.push(getAllState(storage));
await c.shutdown();
return states;
}

Expand Down

0 comments on commit c4edf96

Please sign in to comment.