From ec2df9eac320e94be4e3701f7fe149872ecce384 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 20:13:31 +0000 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 --- .../src/flow-route.integration.test.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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, });