Skip to content

fix(ci): tests hang forever — unref session-cleanup interval - #11

Merged
salmov merged 1 commit into
mainfrom
fix/ci-test-hang
Oct 14, 2026
Merged

salmov merged 1 commit into
mainfrom
fix/ci-test-hang

Conversation

@salmov

@salmov salmov commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Problem

CI test jobs (Node 18/20/22) never finish. All tests pass, but the process stays alive, so node --test hangs until GitHub cancels the job after 6 hours. This happens on main too (run 36990890812, 2026-10-02). Every PR shows 3 pending checks.

Cause

src/index.js starts the 60-second session-cleanup setInterval when the module loads. The tests require() 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.js in 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 security job (npm audit --audit-level=high) still fails. That is a separate issue; see the follow-up PR.

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.
@salmov
salmov merged commit 4c85526 into main Oct 14, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant