From dd06bc083361e9d8f669df88f83ba607644d7620 Mon Sep 17 00:00:00 2001 From: Marcel Wysocki Date: Sun, 15 Nov 2026 18:52:01 +0800 Subject: [PATCH] test(terminal): wait for the newer worker to exit after a kill stop (#9290) Cleanup counts a worker gone once its socket refuses connections, and the worker stops listening before its process exits. The test checked the worker pid right after closeTerminals() resolved, so it failed whenever the worker was still exiting. Wait for the pid to disappear, as the adjacent shutdown tests do. --- packages/server/src/terminal/worker-terminal-manager.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/terminal/worker-terminal-manager.test.ts b/packages/server/src/terminal/worker-terminal-manager.test.ts index e57e413b4..6864c7615 100644 --- a/packages/server/src/terminal/worker-terminal-manager.test.ts +++ b/packages/server/src/terminal/worker-terminal-manager.test.ts @@ -1690,8 +1690,10 @@ it("leaves a worker from a newer Paseo running, reports it incompatible, and clo await manager.closeTerminals(); - expect(isProcessAlive(newer.workerPid)).toBe(false); expect(isProcessAlive(newer.programPid)).toBe(false); + // Cleanup counts the worker gone once its socket refuses connections, which happens before + // its process exits. + await waitForCondition(() => !isProcessAlive(newer.workerPid), 5000); expect(await workerRecords(paseoHome)).toEqual([]); });