From d01cc69ef098cab516316e5f3476ee9a2c66ba0d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 22 Feb 2026 16:30:52 +0000 Subject: [PATCH] test: tighten process timeout fixtures --- src/process/exec.test.ts | 14 +++++++------- src/process/supervisor/supervisor.test.ts | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/process/exec.test.ts b/src/process/exec.test.ts index aa47783d961..cb764b18fba 100644 --- a/src/process/exec.test.ts +++ b/src/process/exec.test.ts @@ -34,10 +34,10 @@ describe("runCommandWithTimeout", () => { it("kills command when no output timeout elapses", async () => { const result = await runCommandWithTimeout( - [process.execPath, "-e", "setTimeout(() => {}, 60)"], + [process.execPath, "-e", "setTimeout(() => {}, 40)"], { - timeoutMs: 1_000, - noOutputTimeoutMs: 35, + timeoutMs: 500, + noOutputTimeoutMs: 20, }, ); @@ -51,11 +51,11 @@ describe("runCommandWithTimeout", () => { [ process.execPath, "-e", - 'process.stdout.write("."); setTimeout(() => process.stdout.write("."), 30); setTimeout(() => process.exit(0), 60);', + 'process.stdout.write("."); setTimeout(() => process.stdout.write("."), 20); setTimeout(() => process.exit(0), 40);', ], { - timeoutMs: 1_000, - noOutputTimeoutMs: 500, + timeoutMs: 500, + noOutputTimeoutMs: 250, }, ); @@ -68,7 +68,7 @@ describe("runCommandWithTimeout", () => { it("reports global timeout termination when overall timeout elapses", async () => { const result = await runCommandWithTimeout( - [process.execPath, "-e", "setTimeout(() => {}, 60)"], + [process.execPath, "-e", "setTimeout(() => {}, 40)"], { timeoutMs: 15, }, diff --git a/src/process/supervisor/supervisor.test.ts b/src/process/supervisor/supervisor.test.ts index 71d7be89373..02f318ee3c4 100644 --- a/src/process/supervisor/supervisor.test.ts +++ b/src/process/supervisor/supervisor.test.ts @@ -19,7 +19,7 @@ describe("process supervisor", () => { const run = await spawnChild(supervisor, { sessionId: "s1", argv: [process.execPath, "-e", 'process.stdout.write("ok")'], - timeoutMs: 2_500, + timeoutMs: 1_000, stdinMode: "pipe-closed", }); const exit = await run.wait(); @@ -32,8 +32,8 @@ describe("process supervisor", () => { const supervisor = createProcessSupervisor(); const run = await spawnChild(supervisor, { sessionId: "s1", - argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"], - timeoutMs: 1_000, + argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"], + timeoutMs: 500, noOutputTimeoutMs: 20, stdinMode: "pipe-closed", }); @@ -48,8 +48,8 @@ describe("process supervisor", () => { const first = await spawnChild(supervisor, { sessionId: "s1", scopeKey: "scope:a", - argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"], - timeoutMs: 1_000, + argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"], + timeoutMs: 500, stdinMode: "pipe-open", }); @@ -58,7 +58,7 @@ describe("process supervisor", () => { scopeKey: "scope:a", replaceExistingScope: true, argv: [process.execPath, "-e", 'process.stdout.write("new")'], - timeoutMs: 2_500, + timeoutMs: 1_000, stdinMode: "pipe-closed", }); @@ -73,7 +73,7 @@ describe("process supervisor", () => { const supervisor = createProcessSupervisor(); const run = await spawnChild(supervisor, { sessionId: "s-timeout", - argv: [process.execPath, "-e", "setTimeout(() => {}, 60)"], + argv: [process.execPath, "-e", "setTimeout(() => {}, 40)"], timeoutMs: 1, stdinMode: "pipe-closed", }); @@ -88,7 +88,7 @@ describe("process supervisor", () => { const run = await spawnChild(supervisor, { sessionId: "s-capture", argv: [process.execPath, "-e", 'process.stdout.write("streamed")'], - timeoutMs: 2_500, + timeoutMs: 1_000, stdinMode: "pipe-closed", captureOutput: false, onStdout: (chunk) => {