You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b992d67
Browse filesBrowse the repository at this point in the historyBrowse files
Keep --test-force-exit out of the Node 24 exit deadlock (#1038) (#1053)
The Windows hang of test/sandbox-blocked.test.js was no leaked handle:
process.exit() from --test-force-exit deadlocks in DisposePlatform when a
background Maglev compile is waiting for a main-thread GC
(nodejs/node#64274, fix pending in nodejs/node#66171). It reproduces on
macOS too: 5 of 150 runs hung, 0 of 150 with --no-maglev
--no-concurrent-sparkplug.
The unit suite stays without the flag, now for a known reason. The E2E
suite keeps it and gets the two V8 flags, which only reach the runner's
Node processes, not the Electron app under test.
Co-authored-by: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/test-concept.md
+28-10Lines changed: 28 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,13 +56,14 @@ push, everything runs.
56
56
A test that hangs must fail, not hold the gate. On 2026-10-15 a failed E2E test
57
57
on Linux left its process running and the required check waited six hours for
58
58
GitHub to cancel it ([#997](https://github.com/kkrafft1999/snotra/issues/997)).
59
-
Four settings stand in the way of that now:
59
+
Five settings stand in the way of that now:
60
60
61
61
| Limit | Where | Value | What it catches |
62
62
| --- | --- | --- | --- |
63
63
| Per test, unit suite |`npm test`: `--test-timeout`| 120 s | A test or a `t.after` hook that never settles |
64
64
| Per test, E2E suite |`npm run test:e2e`: `--test-timeout`| 300 s | The same for the app tests, above their own budgets of 60–240 s |
65
65
| End of the file |`npm run test:e2e`: `--test-force-exit`| — | A file whose tests are done but which a leaked handle — a server, a child process, a timer — keeps alive |
66
+
| Exit without deadlock |`npm run test:e2e`: `--no-maglev --no-concurrent-sparkplug`| — |`--test-force-exit` itself hanging in `process.exit()` on Node 24 (#1038) |
66
67
| Per CI job |`ci.yml`: `timeout-minutes`| 20 min | Whatever hangs outside a test: setup, `npm ci`, code at the top level of a test file |
67
68
68
69
How they work together:
@@ -76,15 +77,32 @@ How they work together:
76
77
waiting for is still pending, and the file runs forever. `--test-force-exit`
77
78
ends each file once its tests are through; without it the per-test limit
78
79
marks the test red and the job still hangs.
79
-
-**The unit suite runs without `--test-force-exit`.** On Windows the flag
80
-
made `test/sandbox-blocked.test.js` hang after its last test, in three of
81
-
six runs: the file's tests were through, its process never ended, and the
82
-
job limit cancelled it after 20 minutes (#1038). Without the flag the unit
83
-
suite ended in every one of the 37 Windows runs before #1029; a test that
84
-
hangs is still cut off by `--test-timeout`, and the job limit catches the
85
-
rest. The E2E suite, where
86
-
the hang of #997 happened, keeps the flag. Whether the unit suite gets it
87
-
back is #1038's question.
80
+
-**`--test-force-exit` can hang by itself on Node 24.** It ends a file by
81
+
calling `process.exit()` the moment the last test is through. That call
82
+
joins V8's background threads without tearing the isolate down first. If a
83
+
background JIT compile (Maglev or Sparkplug) is waiting for a garbage
84
+
collection at that moment, it waits for the main thread, the main thread
0 commit comments