test(windows): daemon-pid-reuse cleanup retries a still-held temp dir (#2304)

afterEach SIGKILLs the servers and the detached daemon, waits 50 ms and
removes the temp dir. A killed process releases its handles asynchronously on
Windows, and under full-suite load the removal hit EPERM on the VM (the test
itself passed; it passes 3/3 alone). Retry the removal like the other
process-spawning suites do.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Colby Mchenry
2026-10-02 10:36:42 +00:00
committed by GitHub
parent e0f9c95e2f
commit 9d4e805bec
+3 -1
View File
@@ -197,7 +197,9 @@ describe('Shared MCP daemon (issue #411)', () => {
}
await new Promise((r) => setTimeout(r, 50));
servers.length = 0;
fs.rmSync(tempDir, { recursive: true, force: true });
// A killed process releases its handles asynchronously on Windows; under
// full-suite load 50 ms is not always enough, so retry EPERM/EBUSY.
fs.rmSync(tempDir, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 });
});
it('takes over after SIGKILL even when the stale PID has been reused (#1553)', async () => {