From 8e403f9d4b496b0b0aff50fa3673f889f6a22cb1 Mon Sep 17 00:00:00 2001 From: VOIDXAI Date: Wed, 1 Apr 2026 04:04:24 +0800 Subject: [PATCH] tests: reduce background task timing flakiness (#37) Co-authored-by: VOIDXAI --- tests/fake-codex-fixture.mjs | 2 +- tests/runtime.test.mjs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/fake-codex-fixture.mjs b/tests/fake-codex-fixture.mjs index a85fd31..1e6f13d 100644 --- a/tests/fake-codex-fixture.mjs +++ b/tests/fake-codex-fixture.mjs @@ -467,7 +467,7 @@ rl.on("line", (line) => { } } send({ method: "turn/completed", params: { threadId: thread.id, turn: buildTurn(turnId, "completed") } }); - }, 400); + }, 5000); interruptibleTurns.set(turnId, { threadId: thread.id, timer }); } else if (BEHAVIOR === "slow-task") { emitTurnCompletedLater(thread.id, turnId, items, 400); diff --git a/tests/runtime.test.mjs b/tests/runtime.test.mjs index 56ba6c1..6000c89 100644 --- a/tests/runtime.test.mjs +++ b/tests/runtime.test.mjs @@ -554,7 +554,7 @@ test("task --background enqueues a detached worker and exposes per-job status", const waitedStatus = run( "node", - [SCRIPT, "status", launchPayload.jobId, "--wait", "--timeout-ms", "5000", "--json"], + [SCRIPT, "status", launchPayload.jobId, "--wait", "--timeout-ms", "15000", "--json"], { cwd: repo, env: buildEnv(binDir) @@ -1276,7 +1276,7 @@ test("cancel sends turn interrupt to the shared app-server before killing a brok return job; } return null; - }); + }, { timeoutMs: 15000 }); const cancelResult = run("node", [SCRIPT, "cancel", jobId, "--json"], { cwd: repo,