From 84334a1f341605c5ecdac99ab8756dd6ec9feee2 Mon Sep 17 00:00:00 2001 From: agent_coder Date: Mon, 6 Jul 2026 04:07:25 +0300 Subject: [PATCH] =?UTF-8?q?test(int):=20drop=20redundant=20forceExit=20?= =?UTF-8?q?=E2=80=94=20bounded=20teardown=20already=20un-hangs=20test:int?= =?UTF-8?q?=20(#382)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The int suite could not self-exit after the ESM fix (8e125799) unmasked 4 specs, and was patched with two things: forceExit:true AND a bounded destroyTestDb (sql.end({ timeout: 5 })). The bounded teardown is the real fix — postgres.js .end() without a timeout blocks indefinitely on a stuck pooled connection (the CI-observed "Jest did not exit"); the { timeout: 5 } grace drains then force-closes sockets so teardown always completes. forceExit was redundant belt-and-suspenders that also HID whether the process truly exits on its own. Removing it: every handle-creating spec is verified to close its handle — ai-chat-stream closes its http.createServer in a finally, public-share-workspace-limiter closes its ioredis via redis.quit() in afterAll, and the shared DB pools close via the bounded destroyTestDb. --detectOpenHandles is clean and the suite self-exits. Kept: the bounded destroyTestDb (defense for a genuinely stuck connection). Co-Authored-By: Claude Opus 4.8 (1M context) --- apps/server/test/jest-integration.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/server/test/jest-integration.json b/apps/server/test/jest-integration.json index 43f366f5..30f62397 100644 --- a/apps/server/test/jest-integration.json +++ b/apps/server/test/jest-integration.json @@ -16,7 +16,6 @@ "testEnvironment": "node", "testTimeout": 60000, "maxWorkers": 1, - "forceExit": true, "globalSetup": "/test/integration/global-setup.ts", "globalTeardown": "/test/integration/global-teardown.ts", "moduleNameMapper": {