From fe9e027d58c07aa9a8d819d9126ecc963c2448a8 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 16 Jan 2026 19:46:33 +0000 Subject: [PATCH] test: deflake background exec timeout --- src/agents/bash-tools.exec.background-abort.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/agents/bash-tools.exec.background-abort.test.ts b/src/agents/bash-tools.exec.background-abort.test.ts index a13dc2237..5914541bb 100644 --- a/src/agents/bash-tools.exec.background-abort.test.ts +++ b/src/agents/bash-tools.exec.background-abort.test.ts @@ -63,7 +63,7 @@ test("background exec still times out after tool signal abort", async () => { abortController.abort(); let finished = getFinishedSession(sessionId); - const deadline = Date.now() + 2000; + const deadline = Date.now() + (process.platform === "win32" ? 10_000 : 2_000); while (!finished && Date.now() < deadline) { await sleep(20); finished = getFinishedSession(sessionId); @@ -72,6 +72,7 @@ test("background exec still times out after tool signal abort", async () => { const running = getSession(sessionId); try { + expect(finished).toBeTruthy(); expect(finished?.status).toBe("failed"); } finally { const pid = running?.pid; @@ -121,7 +122,7 @@ test("yielded background exec still times out", async () => { const sessionId = (result.details as { sessionId: string }).sessionId; let finished = getFinishedSession(sessionId); - const deadline = Date.now() + 2000; + const deadline = Date.now() + (process.platform === "win32" ? 10_000 : 2_000); while (!finished && Date.now() < deadline) { await sleep(20); finished = getFinishedSession(sessionId); @@ -130,6 +131,7 @@ test("yielded background exec still times out", async () => { const running = getSession(sessionId); try { + expect(finished).toBeTruthy(); expect(finished?.status).toBe("failed"); } finally { const pid = running?.pid;