From d353c7496e2469b807003c74ab6e01cdcaa2c3d8 Mon Sep 17 00:00:00 2001 From: Lily Shen <115414357+lilyshen0722@users.noreply.github.com> Date: Sun, 1 Nov 2026 08:54:40 -0800 Subject: [PATCH] =?UTF-8?q?test(cli):=20widen=20the=20supervised-turn=20gr?= =?UTF-8?q?andchild=20reap=20window=202s=E2=86=925s=20to=20deflake=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "a stalled child in its own group is killed with its grandchild" test cancels the stuck turn, then waits for the detached grandchild to exit before asserting it is no longer running. The grandchild dies via the process-group signal, whose OS teardown a loaded CI host can take several seconds to finish after the kill lands — the kill is synchronous, the reap is not. A 2s deadline flaked ("Received: true") on run 41327545667; adjacent merge-queue/cto runs of the same job passed. Widen the reap window to 5s (the test timeout is 15s); no assertion is weakened — the test still requires both child and grandchild dead. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_015AKgpNr8tFMMj8aFvFPUdA --- cli/__tests__/supervised-turn.test.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/__tests__/supervised-turn.test.mjs b/cli/__tests__/supervised-turn.test.mjs index c8a9e02ba2..e470737f61 100644 --- a/cli/__tests__/supervised-turn.test.mjs +++ b/cli/__tests__/supervised-turn.test.mjs @@ -209,7 +209,10 @@ describe('the turn runner', () => { expect(error.kind).toBe('stuck'); expect(ownGroup).toBe(process.platform !== 'win32'); expect(Number.isInteger(grandchild)).toBe(true); - const deadline = Date.now() + 2000; + // 5 s, not 2: the grandchild is detached and dies via the group signal, whose + // OS teardown a loaded CI host can take several seconds to finish after the kill + // lands — the kill is synchronous, the reap is not. The test timeout is 15 s. + const deadline = Date.now() + 5000; while ((isRunning(child.pid) || isRunning(grandchild)) && Date.now() < deadline) { // eslint-disable-next-line no-await-in-loop await new Promise((r) => setTimeout(r, 20));