Skip to content

Commit ec2df9e

Browse files
committed
test(plugin-approvals): boot the #38838 publish-refusal describe's kernel once
The first case paid a cold kernel.bootstrap() inside vitest's 5 s default and timed out on loaded CI shards. One beforeAll(boot, 30_000) with an afterAll shutdown; the cases share it safely (own flow names, refusals write nothing, the control's row is read by no other case). Same shape as this describe in PR #38970. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2
1 parent 38ab473 commit ec2df9e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎packages/plugins/plugin-approvals/src/flow-route.integration.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* both sides on purpose: the trunk is served unchanged.
4646
*/
4747

48-
import { describe, it, expect, beforeAll, beforeEach, afterAll, afterEach } from 'vitest';
48+
import { describe, it, expect, beforeAll, beforeEach, afterAll } from 'vitest';
4949
import { ObjectKernel } from '@objectstack/core';
5050
import { ObjectQL, ObjectQLPlugin } from '@objectstack/objectql';
5151
import { SqlDriver } from '@objectstack/driver-sql';
@@ -789,7 +789,13 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () =>
789789
let ql: ObjectQL;
790790
let protocol: any;
791791

792-
afterEach(async () => {
792+
// ONE kernel for the describe (#38976): a cold `kernel.bootstrap()` per case
793+
// pushed the first case past vitest's 5 s default on loaded CI shards. The
794+
// cases share it safely: each saves under its own flow name and reads back
795+
// only that name; the refusals write nothing, and the one write (the
796+
// control's publish) is a row no other case reads.
797+
beforeAll(() => boot(), 30_000);
798+
afterAll(async () => {
793799
try { await kernel?.shutdown(); } catch { /* noop */ }
794800
});
795801

@@ -815,7 +821,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () =>
815821
const LEAD = 'Node `start` fans out to concurrent branches that each reach a node that parks the run';
816822

817823
it('an active save is refused with 422 INVALID_METADATA, naming the fan-out and both branches', async () => {
818-
await boot();
819824
const err = await protocol.saveMetaItem({
820825
type: 'flow', name: 'fan_out_active', item: unconditionalFanOut('fan_out_active'), packageId: PKG,
821826
}).catch((e: any) => e);
@@ -829,7 +834,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () =>
829834
it('a draft save is refused too: the flow schema is judged at every save, a draft included', async () => {
830835
// Measured: the schema half of the door runs on a draft (only the author-time
831836
// lint waits for the promotion), so this never reaches the publish step.
832-
await boot();
833837
const err = await protocol.saveMetaItem({
834838
type: 'flow', name: 'fan_out_draft', item: unconditionalFanOut('fan_out_draft'), packageId: PKG, mode: 'draft',
835839
}).catch((e: any) => e);
@@ -846,7 +850,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () =>
846850
});
847851

848852
it('CONTROL: the conditional fan-out (one edge taken) publishes', async () => {
849-
await boot();
850853
const out = await protocol.saveMetaItem({
851854
type: 'flow', name: 'fan_out_conditional', item: conditionalFanOut('fan_out_conditional'), packageId: PKG,
852855
});

0 commit comments

Comments
 (0)