Repository navigation
Distinguish a process abort from a genuine test failure in the pre-push gate - #2475
Merged
Merged
Conversation
…sh gate A load-induced abort (SIGSEGV under parallel-test resource contention, observed intermittently in nodespace-core's lib tests) and a real assertion failure currently look identical in scripts/test-gate.ts's output: "script exited with code 101, push blocked." Telling them apart today means re-running a multi-minute suite, which also trains people toward `git push --no-verify`. Adds scripts/classify-test-failure.ts: scans captured stdout/stderr for known abort signatures (SIGSEGV/SIGABRT/SIGBUS/SIGILL/SIGKILL, "signal: N", segmentation fault, core dumped, the Windows STATUS_ACCESS_VIOLATION equivalent) and, when found, prints a note before the existing failure message in test-gate.ts's run() catch block. Does not change the outcome — an abort still blocks the push, same as any other failure — only what the person sees. This does not root-cause the underlying SIGSEGV itself (suspected libsql/SQLite FFI under concurrency, or cold-build/test-load overlap after a merge) — that needs real Rust/FFI investigation and stays out of scope here. 12 new tests, each mutation-tested individually (temporarily broke the corresponding logic, confirmed the test failed, restored, confirmed it passed). One caught a real mutation-testing escape in its own first draft: a segmentation-fault fixture that also contained "core dumped" let a broken case-insensitivity check pass, since the separate core-dumped pattern still matched; fixed by using a fixture string that isolates only the pattern under test. Co-Authored-By: Claude <[email protected]>
3 tasks
Adversarial review of the classifier found two of the ten ABORT_PATTERNS regexes — "process didn't exit successfully... (signal" and STATUS_ACCESS_VIOLATION — were only ever exercised alongside another already-matching pattern (SIGSEGV / signal:\s*\d+), so a typo in either specific regex wouldn't be caught by the existing suite. Adds one isolated fixture per pattern, each avoiding every other ABORT_PATTERNS trigger, and mutation-tested individually (broke each pattern in turn, confirmed only its own test failed, restored, confirmed all 14 pass). Co-Authored-By: Claude <[email protected]>
Contributor
Author
|
Addressed the two testable nits from review in 2a43ebc: added isolated fixtures for the two ABORT_PATTERNS entries that were previously only ever exercised alongside an already-matching pattern ("process didn't exit successfully...(signal" and STATUS_ACCESS_VIOLATION), each mutation-tested individually. 14/14 tests pass, Left as-is (per the review's own framing — cosmetic, non-blocking):
|
mstomar125
deleted the
issue-2431-distinguish-test-abort-from-failure
branch
September 8, 2026 11:11
4 tasks
4 tasks done
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.
Summary
Scoped narrowly, per the issue's own framing risk: this distinguishes a process abort (e.g. the intermittent SIGSEGV seen in nodespace-core's lib tests under parallel-test resource contention) from a genuine test/assertion failure in
scripts/test-gate.ts's (ADR-047) reporting. It does not root-cause the underlying SIGSEGV — that needs real Rust/FFI investigation (suspects: libsql/SQLite FFI under concurrency, or a post-merge cold-build/test-load overlap) and is out of scope for a reporting change.Today, a load-induced abort and a real regression print identically —
✗ <step> failed — push blocked.— which costs a multi-minute rerun just to find out which one happened, and nudges people towardgit push --no-verifywhen they assume (often correctly, sometimes not) that it was "just the flaky SIGSEGV thing."What changed
scripts/classify-test-failure.ts(new):classifyFailure(output)scans captured text for known abort signatures (SIGSEGV/SIGABRT/SIGBUS/SIGILL/SIGKILL,signal: N, "segmentation fault", "core dumped", Windows'STATUS_ACCESS_VIOLATION) and returns"abort" | "failure"— defaulting to"failure"(silence is the safe default).extractFailureOutput(err)pulls the text worth scanning out of a thrown error, mirroringcheck-branch-behind.ts'serrorMessage()pattern: Bun'sShellErrorexposes.stdout/.stderras Buffers (populated alongside the live terminal stream), which is where cargo's abort message actually shows up —.messagealone is a generic "Failed with exit code N".formatAbortNote(label)renders the note.scripts/test-gate.ts:run()'s catch block now classifies the captured output and, on"abort", prints the note before the existing "push blocked" message. The outcome is unchanged — an abort still blocks the push, exactly like any other failure; retrying is still on the person, not automated.What this does NOT do (explicitly out of scope)
packages/agentorpackages/nlp-engine.Test plan
scripts/classify-test-failure.test.ts— 12 new tests: real cargo SIGSEGV output, a genuine assertion failure, empty output, bare SIGABRT, case-insensitive segmentation fault, prose that merely mentions "signal" without a number (negative case), stdout/stderr Buffer joining,.messagefallback, non-object/non-Buffer guards, and the note's content/shape. Each mutation-tested individually (temporarily broke the corresponding logic, confirmed the specific test failed, restored, confirmed all pass). One test's own fixture string was found to be a mutation-testing escape during that pass — a segmentation-fault case that also contained "core dumped" let a broken case-insensitivity check pass, since the separate core-dumped pattern still matched — fixed by isolating the fixture to the pattern under test, then re-verified the mutation now correctly fails it.bun run test:scripts— 361 tests pass (fullscripts/suite, no new failures).bun run test:all— clean, no new failures.bun run quality:fix— clean.Acceptance criteria status (from the issue)
Leaving the issue open after this merges — the reporting half is done, but the actual SIGSEGV is still there and still needs someone with Rust/FFI context to chase it.
🤖 Generated with Claude Code