Repository navigation
fix(ci): --test-force-exit damit CI nicht mehr hängt - #4
Merged
Merged
Conversation
Tests pass locally (194/194, ~650ms) but the process never exits in CI. Root cause: FileWatchConnector uses fs.watch() and SystemConnector uses setInterval — both have afterEach cleanup but fs.watch handles on Linux sometimes stay open after close(), blocking process exit. Node 22+ supports --test-force-exit which terminates cleanly after all tests complete, regardless of dangling handles. - Fixes hanging CI runs since 2026-03-30 - Tests still pass (0 errors) with same coverage - Local run: 0.84s total (was: hang indefinitely)
rockywuest
added a commit
that referenced
this pull request
Oct 17, 2026
…#4) Tests pass locally (194/194, ~650ms) but the process never exits in CI. Root cause: FileWatchConnector uses fs.watch() and SystemConnector uses setInterval — both have afterEach cleanup but fs.watch handles on Linux sometimes stay open after close(), blocking process exit. Node 22+ supports --test-force-exit which terminates cleanly after all tests complete, regardless of dangling handles. - Fixes hanging CI runs since 2026-03-30 - Tests still pass (0 errors) with same coverage - Local run: 0.84s total (was: hang indefinitely)
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 hängt seit 2026-03-30 unendlich lang, wird nach ~6h von GitHub gecancelled.
Lokaler Test zeigt: alle 194 Tests passen in ~650ms, aber der Node-Prozess exitiert nicht.
Root Cause
FileWatchConnectornutztfs.watch()(plugins/nox-event-bus/connectors/filewatch.js:32)SystemConnectornutztsetInterval()(plugins/nox-event-bus/connectors/system.js:30)afterEach-Cleanup (watcher.close(),clearInterval())Fix
--test-force-exitFlag (Node 22+) sorgt dafür, dass nach Abschluss aller Tests der Prozess sauber terminiert wird, unabhängig von hängenden Handles.Verifikation
npm testhängt >45s ohne Exitnpm testbeendet in 0.84s (194/194 passed)Alternative (nicht gewählt)
Man könnte stattdessen in
fs.watch-basiertem Code explizitprocess._getActiveHandles()aufräumen, aber das ist fragil.--test-force-exitist der offiziell supportete Node-Weg für genau diesen Fall.