Skip to content

Commit

Permalink
Merge pull request #8669 from Agoric/slogulator-refresh
Browse files Browse the repository at this point in the history
Refresh slogulator to account for smallcaps
  • Loading branch information
mergify[bot] authored Jan 18, 2024
2 parents 51f64c2 + 73aa6d6 commit 046af59
Show file tree
Hide file tree
Showing 7 changed files with 410 additions and 155 deletions.
13 changes: 2 additions & 11 deletions packages/SwingSet/tools/run-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ const sink = () => {};

/**
* @param {import('../src/controller/controller.js').SwingsetController} controller
* @param {(...args: any[]) => void} [log]
*/
export const makeRunUtils = (controller, log = (..._) => {}) => {
let cranksRun = 0;

export const makeRunUtils = controller => {
const mutex = makeQueue();

mutex.put(controller.run());
Expand All @@ -27,18 +24,12 @@ export const makeRunUtils = (controller, log = (..._) => {}) => {

const thunkResult = await thunk();

const result = controller.run().then(cranks => {
cranksRun += cranks;
log(`kernel ran ${cranks} cranks`);
return thunkResult;
});
const result = controller.run().then(() => thunkResult);
mutex.put(result.then(sink, sink));
return result;
};

const queueAndRun = async (deliveryThunk, voidResult = false) => {
log('queueAndRun at', cranksRun);

const kpid = await runThunk(deliveryThunk);

if (voidResult) {
Expand Down
2 changes: 1 addition & 1 deletion packages/boot/test/upgrading/test-upgrade-vats.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const makeScenario = async (
t.teardown(c.shutdown);
c.pinVatRoot('bootstrap');

const runUtils = makeRunUtils(c, t.log);
const runUtils = makeRunUtils(c);
return runUtils;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/boot/tools/supports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export const makeSwingsetTestKit = async (
);
console.timeLog('makeBaseSwingsetTestKit', 'buildSwingset');

const runUtils = makeRunUtils(controller, log);
const runUtils = makeRunUtils(controller);

const buildProposal = makeProposalExtractor({
childProcess: childProcessAmbient,
Expand Down
1 change: 1 addition & 0 deletions packages/swingset-runner/bin/slogulator-debug
17 changes: 17 additions & 0 deletions packages/swingset-runner/src/slogulator-debug-entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node --inspect-brk
/* eslint-env node */

/**
* Simple boilerplate program providing linkage to launch an application written using modules within the
* as yet not-entirely-ESM-supporting version of NodeJS.
*/
import '@endo/init';
import { main } from './slogulator.js';

process.exitCode = 1;
try {
main();
process.exitCode = 0;
} catch (error) {
console.error(error);
}
14 changes: 6 additions & 8 deletions packages/swingset-runner/src/slogulator-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import '@endo/init';
import { main } from './slogulator.js';

process.exitCode = 1;
main().then(
() => {
process.exitCode = 0;
},
error => {
console.error(error);
},
);
try {
main();
process.exitCode = 0;
} catch (error) {
console.error(error);
}
Loading

0 comments on commit 046af59

Please sign in to comment.