Skip to content

Commit

Permalink
Revert "fix: split test in attempt to evade CI badness"
Browse files Browse the repository at this point in the history
This reverts commit e8055a4.
  • Loading branch information
mhofman authored and mergify[bot] committed Jul 1, 2022
1 parent 9ed4278 commit 5ca5d0e
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 110 deletions.
110 changes: 0 additions & 110 deletions packages/SwingSet/test/vat-admin/terminate/test-terminate-critical.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,37 @@ async function doTerminateNonCritical(
t.is(postProbe, undefined);
}

async function doTerminateCritical(t, deadVatID, mode, dynamic) {
const configPath = new URL('swingset-terminate.json', import.meta.url)
.pathname;
const config = await loadSwingsetConfigFile(configPath);
const hostStorage = provideHostStorage();
const controller = await buildVatController(config, [mode, true, dynamic], {
...t.context.data,
hostStorage,
});
t.is(controller.kpStatus(controller.bootstrapResult), 'unresolved');
const preProbe = hostStorage.kvStore.get(`${deadVatID}.options`);
if (!dynamic) {
t.truthy(preProbe);
}

const err = await t.throwsAsync(() => controller.run());
const body = JSON.parse(err.message);
if (typeof body === 'string') {
t.is(body, mode);
} else {
t.is(body['@qclass'], 'error');
t.is(body.message, mode);
}
t.is(
controller.kpStatus(controller.bootstrapResult),
dynamic ? 'unresolved' : 'fulfilled',
);
const postProbe = hostStorage.kvStore.get(`${deadVatID}.options`);
t.is(postProbe, undefined);
}

test('terminate (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -79,6 +110,12 @@ test('terminate (dynamic, non-critical)', async t => {

// no test 'terminate (static, non-critical)' because static vats can't be killed

test('terminate (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'kill', true);
});

// no test 'terminate (static, critical)' because static vats can't be killed

test('exit happy path simple result (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -99,6 +136,14 @@ test('exit happy path simple result (static, non-critical)', async t => {
);
});

test('exit happy path simple result (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'happy', true);
});

test('exit happy path simple result (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'happy', false);
});

test('exit happy path complex result (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -119,6 +164,14 @@ test('exit happy path complex result (static, non-critical)', async t => {
);
});

test('exit happy path complex result (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'exceptionallyHappy', true);
});

test('exit happy path complex result (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'exceptionallyHappy', false);
});

test('exit sad path simple result (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -139,6 +192,14 @@ test('exit sad path simple result (static, non-critical)', async t => {
);
});

test('exit sad path simple result (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'sad', true);
});

test('exit sad path simple result (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'sad', false);
});

test('exit sad path complex result (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -159,6 +220,14 @@ test('exit sad path complex result (static, non-critical)', async t => {
);
});

test('exit sad path complex result (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'exceptionallySad', true);
});

test('exit sad path complex result (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'exceptionallySad', false);
});

test('exit happy path with ante-mortem message (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -181,6 +250,14 @@ test('exit happy path with ante-mortem message (static, non-critical)', async t
);
});

test('exit happy path with ante-mortem message (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'happyTalkFirst', true);
});

test('exit happy path with ante-mortem message (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'happyTalkFirst', false);
});

test('exit sad path with ante-mortem message (dynamic, non-critical)', async t => {
await doTerminateNonCritical(
t,
Expand All @@ -207,6 +284,14 @@ test('exit sad path with ante-mortem message (static, non-critical)', async t =>
);
});

test('exit sad path with ante-mortem message (dynamic, critical)', async t => {
await doTerminateCritical(t, 'v8', 'sadTalkFirst', true);
});

test('exit sad path with ante-mortem message (static, critical)', async t => {
await doTerminateCritical(t, 'v6', 'sadTalkFirst', false);
});

test('exit with presence', async t => {
const configPath = new URL('swingset-die-with-presence.json', import.meta.url)
.pathname;
Expand Down Expand Up @@ -264,6 +349,16 @@ test.serial('dispatches to the dead do not harm kernel', async t => {
}
});

test('invalid criticalVatKey causes vat creation to fail', async t => {
const configPath = new URL('swingset-bad-vat-key.json', import.meta.url)
.pathname;
const config = await loadSwingsetConfigFile(configPath);
const controller = await buildVatController(config, [], t.context.data);
await t.throwsAsync(() => controller.run(), {
message: /invalid criticalVatKey/,
});
});

test('dead vat state removed', async t => {
const configPath = new URL('swingset-die-cleanly.json', import.meta.url)
.pathname;
Expand Down

0 comments on commit 5ca5d0e

Please sign in to comment.