diff --git a/src/test/timeouts.ts b/src/test/timeouts.ts index 66ad0f9..9277994 100644 --- a/src/test/timeouts.ts +++ b/src/test/timeouts.ts @@ -7,3 +7,8 @@ export const REAL_PROCESS_SPAWN_TEST_TIMEOUT_MS = 20_000; * A test that creates, times, stats and removes on the order of hundreds of individual files sequentially (e.g. exercising sweepSpool's own batch cap) issues far more filesystem syscalls than vitest's default test timeout was ever sized for, on any platform — NTFS under CI disk contention has been observed pushing this over 5000ms on a windows-latest runner even though the identical code path stayed well within it on the same run's ubuntu and windows-11-arm legs. Real I/O volume to accommodate, not a correctness concern. */ export const HEAVY_FS_IO_TEST_TIMEOUT_MS = 20_000; + +/** + * Starting the packaged SEA binary is a heavier cold start than a plain CcPeer.create(): it loads and JIT-compiles one large single-file bundle (every dependency inlined, no node_modules resolution to spread the cost across smaller files) rather than a normal small script. A real macos-26-intel CI runner — the first run to ever actually reach this check, since every earlier attempt queued forever against the since-retired macos-13 label — took longer than REAL_PROCESS_SPAWN_TEST_TIMEOUT_MS's own 20s here, confirming this is genuine startup cost on that runner class rather than a hang. + */ +export const SEA_BINARY_STARTUP_TIMEOUT_MS = 60_000; diff --git a/test/sea.e2e.test.ts b/test/sea.e2e.test.ts index cc4bfed..f567b05 100644 --- a/test/sea.e2e.test.ts +++ b/test/sea.e2e.test.ts @@ -5,7 +5,7 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { createServer } from "node:net"; -import { REAL_PROCESS_SPAWN_TEST_TIMEOUT_MS } from "../src/test/timeouts.js"; +import { SEA_BINARY_STARTUP_TIMEOUT_MS } from "../src/test/timeouts.js"; /** * Exercises the actual packaged single-executable artifact CI ships, not the in-process TS modules every other tier tests: a real, separate process, started the way an end user would, over the network. Requires CC_PEER_SEA_BINARY (the path to a binary already built by scripts/build-sea.ts) — this test does not build one itself, since a SEA build needs a Node distribution with the feature enabled and takes real time, neither of which belongs in a test's own setup. @@ -82,7 +82,7 @@ describe.skipIf(BINARY === undefined)("packaged SEA binary", () => { stderr += chunk.toString("utf8"); }); try { - await waitForPort(port, REAL_PROCESS_SPAWN_TEST_TIMEOUT_MS); + await waitForPort(port, SEA_BINARY_STARTUP_TIMEOUT_MS); const health = await fetch( `http://127.0.0.1:${port.toString()}/healthz`, @@ -110,6 +110,6 @@ describe.skipIf(BINARY === undefined)("packaged SEA binary", () => { child.kill(); } }, - REAL_PROCESS_SPAWN_TEST_TIMEOUT_MS, + SEA_BINARY_STARTUP_TIMEOUT_MS, ); });