From 170c1ca7f79c2221cd416b0eb0ffc098da5375fb Mon Sep 17 00:00:00 2001 From: Priyanshu Choudhary <57816400+Priyanchew@users.noreply.github.com> Date: Wed, 29 Apr 2026 04:41:46 +0530 Subject: [PATCH] fix(test): assert negative pid in start full-stop test killProcessTree on Unix targets the process group first via process.kill(-pid, signal); only falls back to positive pid if that throws. The test mock returns true, so only the negative-pid call ever fires. Update assertion to match the actual call. Caught by CI on Linux (test was Windows-skipped locally). --- packages/cli/__tests__/commands/start.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cli/__tests__/commands/start.test.ts b/packages/cli/__tests__/commands/start.test.ts index 022be9239..9857db1d4 100644 --- a/packages/cli/__tests__/commands/start.test.ts +++ b/packages/cli/__tests__/commands/start.test.ts @@ -2004,7 +2004,10 @@ describe("start command — platform-aware runtime fallback", () => { await program.parseAsync(["node", "test", "stop"]); - expect(killSpy).toHaveBeenCalledWith(99999, "SIGTERM"); + // killProcessTree on Unix targets the process group first via NEGATIVE pid; + // only falls back to positive pid if that throws. The mock returns true, + // so only the negative-pid call fires. + expect(killSpy).toHaveBeenCalledWith(-99999, "SIGTERM"); expect(mockUnregister).toHaveBeenCalled(); expect(mockRemoveProjectFromRunning).not.toHaveBeenCalled();