diff --git a/packages/zoe/test/swingsetTests/zoe/test-zoe-upgrade.js b/packages/zoe/test/swingsetTests/zoe/test-zoe-upgrade.js index febdb8ecccf2..28ed9b656c82 100644 --- a/packages/zoe/test/swingsetTests/zoe/test-zoe-upgrade.js +++ b/packages/zoe/test/swingsetTests/zoe/test-zoe-upgrade.js @@ -2,6 +2,8 @@ import '@agoric/swingset-vat/tools/prepare-test-env.js'; import test from 'ava'; + +import bundleSource from '@endo/bundle-source'; import { buildVatController } from '@agoric/swingset-vat'; import { kunser } from '@agoric/swingset-vat/src/lib/kmarshal.js'; @@ -52,6 +54,18 @@ test('zoe vat upgrade trauma', async t => { const messageObject = (presence, methodName, args) => run('messageVatObject', [{ presence, methodName, args }]); + const restartVatAdminVat = async controller => { + const vaBundle = await bundleSource( + new URL( + '../../../../SwingSet/src/vats/vat-admin/vat-vat-admin.js', + import.meta.url, + ).pathname, + ); + const bundleID = await controller.validateAndInstallBundle(vaBundle); + controller.upgradeStaticVat('vatAdmin', true, bundleID, {}); + await controller.run(); + }; + /** * @see {@link ../upgradeCoveredCall/bootstrap-coveredCall-service-upgrade.js} */ @@ -206,9 +220,14 @@ test('zoe vat upgrade trauma', async t => { pausedFlows.push({ result, remainingSteps: flow.slice(i) }); } + // Null-upgrade vatAdmin. + await restartVatAdminVat(c); + // Null-upgrade Zoe. - const { incarnationNumber } = await run('upgradeVat', [zoeVatConfig]); - t.is(incarnationNumber, 1, 'Zoe vat must be upgraded'); + const { incarnationNumber: zoeIncarnationNumber } = await run('upgradeVat', [ + zoeVatConfig, + ]); + t.is(zoeIncarnationNumber, 1, 'Zoe vat must be upgraded'); // Verify a complete run in the new Zoe. await doSteps('post-upgrade', flow);