From 29a02da275c64d977fd24c647e8a9f7dc7212ff8 Mon Sep 17 00:00:00 2001 From: Sawyer Date: Sat, 5 Sep 2026 23:42:40 -0700 Subject: [PATCH] isolation: give the afterAll shutdown hook headroom past the harness's own kill fallback hub.shutdown() stops the sidecar then the hub in sequence, and each stop() gives its process up to 5s to exit on SIGTERM before escalating to SIGKILL. A graceful-but-slow exit on either process alone can approach Bun's 5000ms default hook timeout, and two of them back to back can exceed it outright, which is what the isolation CI job hit: the hook timed out at ~5001ms with every real assertion passing. Raise the hook's timeout to 20s so a slow-but-clean shutdown on a loaded CI runner has room to finish. --- test/isolation/isolation.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/isolation/isolation.test.ts b/test/isolation/isolation.test.ts index 946d71682c..39a4f5ba89 100644 --- a/test/isolation/isolation.test.ts +++ b/test/isolation/isolation.test.ts @@ -67,9 +67,19 @@ if (!databaseUrl) { await prepareDatabase(databaseUrl); const hub = await bootIsolationHub(databaseUrl); const app: AppLike = hub.app; + // `hub.shutdown()` stops the sidecar then the hub in sequence + // (`test/isolation/setup.ts`), and each `stop()` (`scripts/e2e/ + // harness.ts`) gives its process up to 5s to exit on SIGTERM before + // escalating to SIGKILL — so a graceful-but-slow exit on either + // process alone can approach Bun's 5000ms default hook timeout, and + // two of them in sequence can exceed it outright. CL-7462: this hook + // timed out at ~5001ms in CI once boot wiring grew (workflow + // allocation/dispatch initialization, extra reconciliation queries), + // pushing shutdown latency on CI's shared runners past the default + // margin even though nothing was actually hung. afterAll(async () => { await hub.shutdown(); - }); + }, 20_000); // Unique suffix so the suite can rerun against a database that // already holds rows from a previous run.