From aa79284dc56860cec0ab837251533625f2cb1d34 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sat, 18 Apr 2026 19:57:26 +0900 Subject: [PATCH] fix(background-agent): reset process.exitCode to 0 between cleanup tests CI test suite exited 1 despite 0 failing tests because process-cleanup.test.ts assertions left process.exitCode=1 in place. The afterEach hook only reset to originalExitCode (which starts undefined), not 0, so Bun picked up exitCode=1 on shutdown and reported the shared batch as failing. Explicitly set process.exitCode = 0 in beforeEach and afterEach so each test starts and ends with a clean exit state. --- src/features/background-agent/process-cleanup.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/features/background-agent/process-cleanup.test.ts b/src/features/background-agent/process-cleanup.test.ts index 4d2975fe0..a9ce35435 100644 --- a/src/features/background-agent/process-cleanup.test.ts +++ b/src/features/background-agent/process-cleanup.test.ts @@ -15,10 +15,9 @@ type CleanupManager = { describe("#given process cleanup registration", () => { const registeredManagers: CleanupManager[] = [] - const originalExitCode = process.exitCode beforeEach(() => { - process.exitCode = originalExitCode + process.exitCode = 0 registeredManagers.length = 0 _resetForTesting() }) @@ -28,7 +27,7 @@ describe("#given process cleanup registration", () => { unregisterManagerForCleanup(manager) } - process.exitCode = originalExitCode + process.exitCode = 0 _resetForTesting() })