From 92740823d8be398c458fc102b889a4d0baf66de0 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Thu, 11 Feb 2021 11:13:38 -0600 Subject: [PATCH] fix(xs-worker): restore xs vat manager test to working order In 94e007867 on Feb 7, the 'xs vat manager' grew a `test.skip`. (It's not entirely clear to me why. I can't reproduce the failure as of that version.) So in 43344ad Feb 10, we didn't notice that xs's deliver now returns `Promise` while kernel.js still expects deliver to return `Promise`. Taking out the `test.skip` results in... TypeError#2: deliveryResult is not iterable at kernel.js:374 `const [status, problem] = deliveryResult;` So this changes xs's deliver to just return the .reply part of the CrankResults. I trust it's more or less by design that the actual metering part is not being consumed by anything at this point. --- .../src/kernel/vatManager/manager-subprocess-xsnap.js | 4 ++-- packages/SwingSet/test/workers/test-worker.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js b/packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js index 22bba75b382..2bc763d5428 100644 --- a/packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js +++ b/packages/SwingSet/src/kernel/vatManager/manager-subprocess-xsnap.js @@ -161,14 +161,14 @@ export function makeXsSubprocessFactory({ throw new Error(`failed to setBundle: ${bundleReply}`); } - /** @type { (item: Tagged) => Promise } */ + /** @type { (item: Tagged) => Promise } */ async function deliver(delivery) { parentLog(vatID, `sending delivery`, delivery); transcriptManager.startDispatch(delivery); const result = await issueTagged(['deliver', ...delivery]); parentLog(vatID, `deliverDone`, result.reply[0], result.reply.length); transcriptManager.finishDispatch(); - return result; + return result.reply; } async function replayTranscript() { diff --git a/packages/SwingSet/test/workers/test-worker.js b/packages/SwingSet/test/workers/test-worker.js index 4ee243eb78a..0c01ff85090 100644 --- a/packages/SwingSet/test/workers/test-worker.js +++ b/packages/SwingSet/test/workers/test-worker.js @@ -28,7 +28,7 @@ test('local vat manager', async t => { t.deepEqual(JSON.parse(c.kpResolution(c.bootstrapResult).body), expected); }); -test.skip('xs vat manager', async t => { +test('xs vat manager', async t => { const c = await makeController('xs-worker'); t.teardown(c.shutdown);