Repository navigation
Commit 47f13a0
test(runner): name the child-process crash behind a file-level failure
`npm test` intermittently reported `✖ api/player/world-position.integration.test.ts`
with the bare error `test failed` at `1:1` while all 23 of its subtests printed ✔.
node:test marks a FILE failed when its child process exits non-zero, and the spec
reporter prints only that bare string — `error.exitCode` and `error.signal` are
dropped. So the one number that says whether a test failed, a late rejection set
exit code 1, or the process died natively was never shown.
Over 500+ runs under load, instrumented with a preload logging `unhandledRejection`,
`uncaughtException` and `exit`, found ZERO unhandled rejections and a clean exit
every time but one: that copy died ~300ms after the Socket.IO layer attached with
no stderr and no `exit` event — a native crash, not a leaked promise. The
fire-and-forget `settleTravelLease(...).catch(...)` path is not at fault. Local
Node is 24.15.0 while .nvmrc/Dockerfile/CI pin 22 (nodejs/node#62991 reports
24.15.0-only native crashes on Windows under load; #56645 is a libuv abort at exit).
- run-tests.mjs now prints `child process exited with code N (0xHEX)` plus any
signal on a file-level fail, and warns when the running Node major != .nvmrc.
- The socket test's teardown now disconnects the client and awaits `disconnect`
BEFORE closing the Socket.IO and HTTP servers, so nothing is mid-handshake at
exit. Hygiene — timing is unchanged against the baseline.
- CLAUDE.md documents the signature so the next reader doesn't re-debug the file.
No gameplay behavior changes.
Co-Authored-By: Claude Opus 5 <[email protected]>1 parent 30c3745 commit 47f13a0
3 files changed
Lines changed: 53 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
364 | 371 | | |
365 | 372 | | |
366 | 373 | | |
367 | 374 | | |
| 375 | + | |
| 376 | + | |
368 | 377 | | |
369 | 378 | | |
370 | 379 | | |
| |||
374 | 383 | | |
375 | 384 | | |
376 | 385 | | |
377 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
378 | 390 | | |
379 | 391 | | |
380 | 392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
52 | 66 | | |
53 | 67 | | |
54 | 68 | | |
| |||
63 | 77 | | |
64 | 78 | | |
65 | 79 | | |
66 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
67 | 99 | | |
68 | 100 | | |
69 | 101 | | |
| |||
0 commit comments