diff --git a/src/wrapper/cli.test.ts b/src/wrapper/cli.test.ts index 048c495..bd69bd1 100644 --- a/src/wrapper/cli.test.ts +++ b/src/wrapper/cli.test.ts @@ -6,7 +6,11 @@ import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; -function waitForExit(child: ReturnType, timeoutMs = 1500): Promise { +// Tests spawn a wrapper subprocess and rely on the wrapper to exit quickly. +// When the full test suite runs with concurrency the host can be CPU-constrained +// and subprocess startup/teardown can be delayed. Keep this timeout relaxed +// to avoid flakiness while preserving the test's intent. +function waitForExit(child: ReturnType, timeoutMs = 8000): Promise { return new Promise((resolve, reject) => { const timeout = setTimeout(() => { child.kill("SIGKILL"); @@ -237,7 +241,7 @@ test("wrapper does not exit early on non-terminal toolUse assistant messages", a stdio: ["ignore", "pipe", "pipe"], }); - const exitCode = await waitForExit(child, 2500); + const exitCode = await waitForExit(child, 8000); assert.equal(exitCode, 0); const result = JSON.parse(await readFile(resultPath, "utf8")); @@ -301,7 +305,7 @@ test("wrapper skips blank assistant transcript lines before later tool activity" stdio: ["ignore", "pipe", "pipe"], }); - const exitCode = await waitForExit(child, 2500); + const exitCode = await waitForExit(child, 8000); assert.equal(exitCode, 0); const transcript = await readFile(transcriptPath, "utf8");