Repository navigation
Commit 178c172
committed
test(api): run jest with --no-sparkplug to stop Node 24's V8 worker SIGSEGV
The api suite intermittently lost a worker to SIGSEGV, which jest then
blamed on whichever file that worker happened to be running — an
innocent bystander (env-schema.test.ts in the reported case), which is
why solo and full reruns always passed.
Root cause is not our code. The macOS crash report for the reported
incident survived and correlates to the second (pid 90485, parent 90275,
2026-08-05 00:54:30 JST) with the taxonomy record our own reporter
wrote. It shows `KERN_INVALID_ADDRESS at 0x6` with every faulting frame
inside node itself: ClearStaleLeftTrimmedPointerVisitor::VisitRootPointers
<- InternalFrame::Iterate <- MarkCompactCollector::MarkRoots <-
StackGuard::HandleInterrupts <- Builtins_BaselineOutOfLinePrologue. A
stack-guard interrupt triggers Mark-Compact GC during a Sparkplug
prologue and the half-built frame is walked as a GC root. That is
nodejs/node#62393 (V8 13.6), fixed in Node 25.0.0+ and not backported to
24.x as of 24.18.0. Three occurrences are on record here.
`--no-sparkplug` removes the baseline-JIT stage the race lives in.
It cannot go in NODE_OPTIONS (node rejects it there) and
`node_modules/.bin/jest` is a shim that swallows node flags, so the
script invokes jest.js through node directly; jest-worker forwards
process.execArgv, so workers inherit it.
Bypassing the shim also drops the NODE_PATH it exported (pnpm's hidden
hoist), which surfaced four dependencies `@crowi/api` used but never
declared — a latent bug of its own, invisible to type-check because
tsconfig excludes test files. Declared as devDependencies here.
Not a retry and not a fallback to --maxWorkers=1: the trigger is
removed. Since a probabilistic native crash has no deterministic
regression test, verification is (1) all five workers observably carry
the flag (checked via ps during a run) with 187 suites / 3045 tests
green, and (2) the existing taxonomy pipeline already classifies this
signature, so a recurrence would be recorded. Removal condition is
documented in jest.config.js.
Left alone: `test:server` targets a `lib/` directory that no longer
exists, so it matches nothing; deleting it touches turbo.json and the
root package.json and is out of scope here.
Diagnosis delegated per CLAUDE.md's flake/CI-infra rule. Codex
adversarial review: no findings.1 parent b43b6ef commit 178c172
4 files changed
Lines changed: 93 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
3 | 33 | | |
4 | 34 | | |
5 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
110 | 112 | | |
111 | 113 | | |
112 | 114 | | |
| 115 | + | |
113 | 116 | | |
114 | 117 | | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments