test: deflake background exec timeout

This commit is contained in:
Peter Steinberger
2026-01-16 19:46:33 +00:00
parent 33d17957e5
commit fe9e027d58

View File

@@ -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;