diff --git a/src/process/exec.test.ts b/src/process/exec.test.ts index 7504977a3..5f670f8f4 100644 --- a/src/process/exec.test.ts +++ b/src/process/exec.test.ts @@ -38,10 +38,10 @@ describe("runCommandWithTimeout", () => { it("kills command when no output timeout elapses", async () => { const result = await runCommandWithTimeout( - [process.execPath, "-e", "setTimeout(() => {}, 10_000)"], + [process.execPath, "-e", "setTimeout(() => {}, 1_000)"], { - timeoutMs: 5_000, - noOutputTimeoutMs: 50, + timeoutMs: 1_000, + noOutputTimeoutMs: 35, }, ); @@ -55,11 +55,11 @@ describe("runCommandWithTimeout", () => { [ process.execPath, "-e", - 'let i=0; const t=setInterval(() => { process.stdout.write("."); i += 1; if (i >= 2) { clearInterval(t); process.exit(0); } }, 10);', + 'let i=0; const t=setInterval(() => { process.stdout.write("."); i += 1; if (i >= 2) { clearInterval(t); process.exit(0); } }, 5);', ], { - timeoutMs: 5_000, - noOutputTimeoutMs: 160, + timeoutMs: 1_000, + noOutputTimeoutMs: 120, }, ); @@ -72,7 +72,7 @@ describe("runCommandWithTimeout", () => { it("reports global timeout termination when overall timeout elapses", async () => { const result = await runCommandWithTimeout( - [process.execPath, "-e", "setTimeout(() => {}, 10_000)"], + [process.execPath, "-e", "setTimeout(() => {}, 1_000)"], { timeoutMs: 15, }, diff --git a/src/process/supervisor/supervisor.test.ts b/src/process/supervisor/supervisor.test.ts index 30032c80b..6fb03bb43 100644 --- a/src/process/supervisor/supervisor.test.ts +++ b/src/process/supervisor/supervisor.test.ts @@ -9,7 +9,7 @@ describe("process supervisor", () => { backendId: "test", mode: "child", argv: [process.execPath, "-e", 'process.stdout.write("ok")'], - timeoutMs: 2_000, + timeoutMs: 800, stdinMode: "pipe-closed", }); const exit = await run.wait(); @@ -24,9 +24,9 @@ describe("process supervisor", () => { sessionId: "s1", backendId: "test", mode: "child", - argv: [process.execPath, "-e", "setTimeout(() => {}, 10_000)"], - timeoutMs: 5_000, - noOutputTimeoutMs: 30, + argv: [process.execPath, "-e", "setTimeout(() => {}, 1_000)"], + timeoutMs: 1_000, + noOutputTimeoutMs: 20, stdinMode: "pipe-closed", }); const exit = await run.wait(); @@ -42,8 +42,8 @@ describe("process supervisor", () => { backendId: "test", scopeKey: "scope:a", mode: "child", - argv: [process.execPath, "-e", "setTimeout(() => {}, 10_000)"], - timeoutMs: 10_000, + argv: [process.execPath, "-e", "setTimeout(() => {}, 1_000)"], + timeoutMs: 1_000, stdinMode: "pipe-open", }); @@ -54,7 +54,7 @@ describe("process supervisor", () => { replaceExistingScope: true, mode: "child", argv: [process.execPath, "-e", 'process.stdout.write("new")'], - timeoutMs: 2_000, + timeoutMs: 800, stdinMode: "pipe-closed", }); @@ -71,7 +71,7 @@ describe("process supervisor", () => { sessionId: "s-timeout", backendId: "test", mode: "child", - argv: [process.execPath, "-e", "setTimeout(() => {}, 10_000)"], + argv: [process.execPath, "-e", "setTimeout(() => {}, 1_000)"], timeoutMs: 1, stdinMode: "pipe-closed", }); @@ -88,7 +88,7 @@ describe("process supervisor", () => { backendId: "test", mode: "child", argv: [process.execPath, "-e", 'process.stdout.write("streamed")'], - timeoutMs: 2_000, + timeoutMs: 800, stdinMode: "pipe-closed", captureOutput: false, onStdout: (chunk) => {