Repository navigation
fix(ci): tests hang forever — unref session-cleanup interval - #11
Merged
Merged
Conversation
The module-level setInterval kept the event loop alive, so `node --test` never finished and every CI test job ran until GitHub's 6-hour cancel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CI test jobs (Node 18/20/22) never finish. All tests pass, but the process stays alive, so
node --testhangs until GitHub cancels the job after 6 hours. This happens onmaintoo (run 36990890812, 2026-10-02). Every PR shows 3 pending checks.Cause
src/index.jsstarts the 60-second session-cleanupsetIntervalwhen the module loads. The testsrequire()it, and the open timer keeps the event loop alive.Fix
.unref()on that interval. Production behavior is unchanged: the HTTP server keeps the process alive, and the timer still runs.Verification
node --test src/index.test.jsin Docker: Node 18, 20 and 22 each report 11 pass, 0 fail, exit 0, in a few seconds. Before the fix, the same command timed out at 90 s with all tests passed.The
securityjob (npm audit --audit-level=high) still fails. That is a separate issue; see the follow-up PR.