diff --git a/packages/plugins/plugin-approvals/src/flow-route.integration.test.ts b/packages/plugins/plugin-approvals/src/flow-route.integration.test.ts index abdfa434c64..bf4db0b9fa0 100644 --- a/packages/plugins/plugin-approvals/src/flow-route.integration.test.ts +++ b/packages/plugins/plugin-approvals/src/flow-route.integration.test.ts @@ -45,7 +45,7 @@ * both sides on purpose: the trunk is served unchanged. */ -import { describe, it, expect, beforeAll, beforeEach, afterAll, afterEach } from 'vitest'; +import { describe, it, expect, beforeAll, beforeEach, afterAll } from 'vitest'; import { ObjectKernel } from '@objectstack/core'; import { ObjectQL, ObjectQLPlugin } from '@objectstack/objectql'; import { SqlDriver } from '@objectstack/driver-sql'; @@ -789,7 +789,13 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () => let ql: ObjectQL; let protocol: any; - afterEach(async () => { + // ONE kernel for the describe (#38976): a cold `kernel.bootstrap()` per case + // pushed the first case past vitest's 5 s default on loaded CI shards. The + // cases share it safely: each saves under its own flow name and reads back + // only that name; the refusals write nothing, and the one write (the + // control's publish) is a row no other case reads. + beforeAll(() => boot(), 30_000); + afterAll(async () => { try { await kernel?.shutdown(); } catch { /* noop */ } }); @@ -815,7 +821,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () => const LEAD = 'Node `start` fans out to concurrent branches that each reach a node that parks the run'; it('an active save is refused with 422 INVALID_METADATA, naming the fan-out and both branches', async () => { - await boot(); const err = await protocol.saveMetaItem({ type: 'flow', name: 'fan_out_active', item: unconditionalFanOut('fan_out_active'), packageId: PKG, }).catch((e: any) => e); @@ -829,7 +834,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () => it('a draft save is refused too: the flow schema is judged at every save, a draft included', async () => { // Measured: the schema half of the door runs on a draft (only the author-time // lint waits for the promotion), so this never reaches the publish step. - await boot(); const err = await protocol.saveMetaItem({ type: 'flow', name: 'fan_out_draft', item: unconditionalFanOut('fan_out_draft'), packageId: PKG, mode: 'draft', }).catch((e: any) => e); @@ -846,7 +850,6 @@ describe('[#38838] a fan-out to two approval steps is refused at publish', () => }); it('CONTROL: the conditional fan-out (one edge taken) publishes', async () => { - await boot(); const out = await protocol.saveMetaItem({ type: 'flow', name: 'fan_out_conditional', item: conditionalFanOut('fan_out_conditional'), packageId: PKG, });