From 235fd6b28b2484f3fb7dc94a1bce7c3dc4f19108 Mon Sep 17 00:00:00 2001 From: bompus Date: Fri, 30 Oct 2026 09:05:28 -0600 Subject: [PATCH] test(daemon): wait 40 s for the early-disconnect daemon to exit (#1356) --- __tests__/mcp-daemon.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/__tests__/mcp-daemon.test.ts b/__tests__/mcp-daemon.test.ts index 8be3edfd6..6f204f72c 100644 --- a/__tests__/mcp-daemon.test.ts +++ b/__tests__/mcp-daemon.test.ts @@ -369,12 +369,12 @@ describe('Shared MCP daemon (issue #411)', () => { }); raw.destroy(); server.child.stdin.end(); - const exited = await waitProcessExit(pid, 8000); - if (!exited) { - // Tell a slow exit from a hang; the daemon log shows the shutdown step it waited on. - const late = await waitProcessExit(pid, 20_000); - startupFailure(new Error(`daemon ${pid} did not exit within 8 s of disconnect (exited in the next 20 s: ${late})`)); - } + // A hung reaper (#1356) never exits. On a loaded Windows runner the + // process lingers up to ~20 s after the daemon has logged its `exit` + // event, so the budget is a hang detector, not a latency bound. The + // daemon log shows the shutdown step a hung daemon waited on. + const exited = await waitProcessExit(pid, 40_000); + if (!exited) startupFailure(new Error(`daemon ${pid} did not exit within 40 s of disconnect`)); expect(exited).toBe(true); expect(readDaemonLog(realRoot)).toContain('Shutting down (idle timeout; clients=0)'); expect(fs.existsSync(path.join(realRoot, '.codegraph', 'writer.pid'))).toBe(false);