Skip to content

Commit c0d5e95

Browse files
github-managerclaude
andcommitted
fix: properly await worker teardown in integration tests to prevent open handles
AfterAll was calling worker.close() with a callback but not awaiting it, so Cucumber resolved the hook immediately leaving the HTTP server, Redis, and DB connections open. Node.js would then hang indefinitely waiting for those handles to close. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3cb65a6 commit c0d5e95

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

test/integration/features/shared.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ BeforeAll({ timeout: 1000 }, async function () {
5858
})
5959

6060
AfterAll(async function() {
61-
worker.close(async () => {
62-
await Promise.all([
63-
dbClient.destroy(),
64-
rrDbClient.destroy(),
65-
cacheClient.disconnect(),
66-
])
61+
await new Promise<void>((resolve) => {
62+
worker.close(async () => {
63+
await Promise.all([
64+
cacheClient.disconnect(),
65+
dbClient.destroy(),
66+
rrDbClient.destroy(),
67+
])
68+
resolve()
69+
})
6770
})
6871
})
6972

0 commit comments

Comments
 (0)