Skip to content

test: stop deliberate crash tests from uploading to CI's crash-report server - #34024

Merged
Jarred-Sumner merged 5 commits into
mainfrom
farm/0aa5e712/suppress-deliberate-crash-reports
Jul 12, 2026
Merged

test: stop deliberate crash tests from uploading to CI's crash-report server#34024
Jarred-Sumner merged 5 commits into
mainfrom
farm/0aa5e712/suppress-deliberate-crash-reports

Conversation

@robobun

@robobun robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

test/integration/next-pages/test/dev-server-ssr-100.test.ts was reported RED in build 72106 on :darwin: 26 aarch64 with 5 crashes reported during this test. The test itself is fine on main (last four completed main builds 72110/72020/71943/71860 have no mention of it). The RED was manufactured by CI's crash-report attribution.

Cause

scripts/runner.node.mjs exports BUN_CRASH_REPORT_URL=http://localhost:<remapPort> to every test so real crashes are captured. It only drains /traces when a test exits non-zero (the known caveat is documented in the runner at the drain site).

run-crash-handler.test.ts spawns processes that crash on purpose with env: bunEnv, which inherits that URL, and native-plugin.test.ts's "prints name when plugin crashes" does the same via Bun.$. Both files pass (exit 0), so their five crash reports stay on the remap server:

Segmentation fault at address 0x00000000        # native-plugin
panic: invoked crashByPanic() handler           # run-crash-handler (x2)
Bun ran out of memory                           # run-crash-handler
Segmentation fault at address 0xDEADBEEF        # run-crash-handler

In build 72106 a transient npm-registry hang on one tart agent (66790-tart-26) made dev-server-ssr-100's bun i block for 100 s and time out. That non-zero exit drained /traces, inherited the five deliberate crashes, and became error = "crash reported"; isAlwaysFailure("crash reported") blocks retries, so one transient timeout became a hard RED. next-auth.test.ts hit the same npm hang on the same agent minutes later, got normal retries, and passed on attempt #4.

Same five reports pinned on unrelated tests in other recent PR builds:

  • build 72095: test/js/node/http/node-http-backpressure-max.test.ts ("5 crashes reported", identical list)
  • build 72085: test/js/web/fetch/fetch-leak.test.ts (segfault at 0x0 from native-plugin)

Fix

Set BUN_CRASH_REPORT_URL="" (and BUN_ENABLE_CRASH_REPORTING=0 for the fall-through branch in is_reporting_enabled()) on every spawn that crashes on purpose but is not asserting on upload behaviour:

  • run-crash-handler.test.ts: the three env: bunEnv spawns now use a shared noReportEnv.
  • native-plugin.test.ts: the "prints name when plugin crashes" Bun.$ command sets the two vars inline.

The "automatic crash reporter" and "raise ignoring panic handler" tests already point BUN_CRASH_REPORT_URL at their own local server and are unchanged.

Verification

Simulated CI's remap server and ran the test file against it:

before: CI-server hits: 5  (the /ack uploads listed above)
after:  CI-server hits: 0, 9 pass / 1 skip / 0 fail

bun bd test test/cli/run/run-crash-handler.test.ts passes. native-plugin.test.ts "prints name when plugin crashes" is skipIf(isASAN) so it is skipped under the debug build; a neighbouring case in the same file still loads, and the inline-env override was verified separately (Bun.$\VAR="" ...`reaches the child as an empty string, whichis_reporting_enabled()` treats as disabled).

Test-only change; no src/ diff because the behaviour being fixed lives in the CI runner and the child's env, not in bun itself.


no test proof · iteration 3 · Platform-specific test-only change; deferring to CI.

run-crash-handler.test.ts and native-plugin.test.ts spawn processes that
crash on purpose. They used env: bunEnv, which in CI inherits
BUN_CRASH_REPORT_URL pointing at runner.node.mjs's remap server. The
tests then exit 0, so the runner never drains /traces. Those five crash
reports sit on the server until the next test that exits non-zero, which
gets them attributed as "crash reported" (isAlwaysFailure) and loses
its retries.

In build 72106 a transient npm hang on one macOS 26 tart agent made
dev-server-ssr-100.test.ts time out once; it inherited the five
deliberate crashes (crashByPanic x2, outOfMemory, 0xDEADBEEF,
native_plugin segfault at 0x0) and went straight to RED with no retry.
Builds 72095 and 72085 show the same five reports pinned on
node-http-backpressure-max.test.ts and fetch-leak.test.ts.

Set BUN_CRASH_REPORT_URL="" (and BUN_ENABLE_CRASH_REPORTING=0 for the
fall-through) on every spawn that crashes on purpose but does not itself
assert on reporting. The "automatic crash reporter" tests already
point at their own server and are unchanged.
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

Crash test reporting isolation

Layer / File(s) Summary
Disable reporting for deliberate crashes
test/bundler/native-plugin.test.ts, test/cli/run/run-crash-handler.test.ts
Intentional native-plugin and crash-handler processes disable crash reporting while preserving crash and termination assertions.
Stabilize TLS OOM validation
test/js/node/tls/tls-syscall-fault.test.ts
The TLS OOM fixture disables crash reporting, and the test accepts case-insensitive “out of memory” stderr wording.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: disabling deliberate crash tests from uploading crash reports.
Description check ✅ Passed It covers what changed and how it was verified, though the template headings are renamed rather than exact matches.

Comment @coderabbitai help to get the list of available commands.

@robobun

robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author
Updated 7:59 AM PT - Jul 12th, 2026

@robobun, your commit 99e87749e2dfc1b06f1df05e695e687b16965f04 passed in Build #72237! 🎉


🧪   To try this PR locally:

bunx bun-pr 34024

That installs a local version of the PR into your bun-34024 executable, so you can run:

bun-34024 --bun

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond the inline finding, I grepped for other deliberate-crash spawns (fixture-crash.js callers, crash_handler.panic()) and found none outside this PR's two files and the tls sibling. Also confirmed is_reporting_enabled() returns false for an empty BUN_CRASH_REPORT_URL (src/crash_handler/lib.rs:2704-2705), so the empty-string override is effective.

Extended reasoning...

The env overrides in the diff are correct and mechanical; the only gap is the missed same-class sibling in tls-syscall-fault.test.ts, which the inline comment covers. I checked for further siblings and the empty-string semantics of the env var so a follow-up pass doesn't re-explore those.

Comment thread test/cli/run/run-crash-handler.test.ts
…xture

Same class as the other two files in this PR: the OOM fixture crashed on
purpose with env: bunEnv, so on socket_fault_injection lanes it uploaded
to CI's remap server and the report lingered for the next failing test.
With reporting suppressed the OOM phrasing is now deterministic, so drop
the both-phrasings matcher.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — test-only env overrides to stop deliberate-crash fixtures from polluting CI's remap server. The inline nit on the OOM phrasing matcher only affects a release+non-ASAN+--socket-fault-injection=on build that no CI lane uses; fine to address in a follow-up or ignore.

Extended reasoning...

Overview

Test-only change touching three files: run-crash-handler.test.ts, native-plugin.test.ts, and tls-syscall-fault.test.ts. Each spawn that deliberately crashes now sets BUN_CRASH_REPORT_URL="" / BUN_ENABLE_CRASH_REPORTING=0 so the crash handler doesn't POST to CI's remap server, which was causing unrelated later-failing tests to inherit "crash reported" and lose their retries. No src/ changes.

Security risks

None. Pure test-environment configuration; no auth, crypto, or user-facing surface touched.

Level of scrutiny

Low. The mechanism is well-documented in the PR description with concrete build-number evidence, the fix is a two-env-var override applied identically at each site, and the author verified upload counts (5→0 and 1→0) against a simulated remap server. The two tests that do assert on upload behaviour (automatic crash reporter, raise ignoring panic handler) already point at their own local server and are correctly left untouched.

Other factors

My earlier review flagged the missed tls-syscall-fault.test.ts sibling; it was applied in 46639f6 and the thread is resolved. The remaining inline nit is about the single-phrasing OOM matcher being fragile on a release non-ASAN build with socket_fault_injection force-enabled — a config no CI job runs (the flag defaults to the asan setting per scripts/build/config.ts). On every lane that actually runs this test, SHOW_CRASH_TRACE is compile-time true and the Display phrasing is stable, so the assertion holds. Not blocking; the load-bearing env override is correct regardless.

Comment thread test/js/node/tls/tls-syscall-fault.test.ts Outdated
SHOW_CRASH_TRACE is a compile-time constant (IS_DEBUG || IS_TEST ||
ENABLE_ASAN); on a release non-ASAN build with --socket-fault-injection=on
the OOM phrasing differs. Match the shared substring like
run-crash-handler.test.ts does.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — both earlier review points are addressed in af952f5.

What was reviewed:

  • Env overrides on the five deliberate-crash spawns: BUN_CRASH_REPORT_URL: "" reaches is_reporting_enabled() as empty → disabled, and BUN_ENABLE_CRASH_REPORTING: "0" covers the fall-through branch.
  • The two tests that assert on upload behaviour ("automatic crash reporter", "raise ignoring panic handler") still point at their own local server — unchanged.
  • tls-syscall-fault.test.ts OOM matcher now uses the phrasing-agnostic .toLowerCase().includes("out of memory"), so it holds regardless of SHOW_CRASH_TRACE.
Extended reasoning...

Overview

Test-only change touching three files: test/cli/run/run-crash-handler.test.ts, test/bundler/native-plugin.test.ts, and test/js/node/tls/tls-syscall-fault.test.ts. Each adds BUN_CRASH_REPORT_URL: "" / BUN_ENABLE_CRASH_REPORTING: "0" to subprocess spawns that crash on purpose, so their crash reports don't land on CI's remap server and get misattributed to the next unrelated failing test. The tls test also swaps a two-phrasing OOM matcher for a shared-substring match. No src/ changes.

Security risks

None. This only overrides two env vars on test-spawned child processes to suppress an outbound HTTP POST to a localhost CI server. No new network, filesystem, or auth surface.

Level of scrutiny

Low. The change is mechanical (env-var overrides on Bun.spawn/Bun.$ calls), test-infrastructure-only, and its worst-case failure mode is that a test still uploads a crash report (status quo) or a test assertion on stderr phrasing changes — both would show up immediately in CI, not ship to users.

Other factors

Two prior review rounds were fully addressed: the missed sibling in tls-syscall-fault.test.ts was added in 46639f6, and the phrasing-dependent matcher was made build-config-agnostic in af952f5. Both threads are resolved. The bug-hunting pass on the latest revision found nothing. No CODEOWNERS cover these paths. The PR description documents verification against a simulated remap server (5 uploads → 0) and bun bd test passing.

@robobun

robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Another instance: build 72121 reports test/js/web/fetch/fetch.tls.test.ts RED on :darwin: 26 aarch64 (darwin-test-arm64-4) with the same "4 crashes reported during this test" (the four run-crash-handler.test.ts traces: 2x crashByPanic, Bun ran out of memory, 0xDEADBEEF). One checkServerIdentity case flaked once; the leaked reports turned it into crash reported so it was not retried. Ran the file 120x on the same box with main HEAD: 120/120 pass.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — both earlier review notes (the tls-syscall-fault.test.ts sibling and the OOM phrasing matcher) are addressed; test-only env overrides on deliberate-crash spawns.

Checked: the three env: bunEnvnoReportEnv swaps in run-crash-handler.test.ts cover exactly the spawns that don't self-host BUN_CRASH_REPORT_URL; the two upload-asserting tests still point at their own server. The Bun.$ inline-env form in native-plugin.test.ts reaches the child as an empty string, which is_reporting_enabled() treats as disabled. The .toLowerCase().includes("out of memory") matcher covers both SHOW_CRASH_TRACE phrasings.

Extended reasoning...

Overview

Test-only change touching three files: test/cli/run/run-crash-handler.test.ts, test/bundler/native-plugin.test.ts, and test/js/node/tls/tls-syscall-fault.test.ts. Each file has spawns that deliberately crash a child process; the change sets BUN_CRASH_REPORT_URL="" and BUN_ENABLE_CRASH_REPORTING=0 on those spawns so they no longer POST to CI's per-job remap server. The TLS file also swaps a two-string OOM matcher for a phrasing-agnostic .toLowerCase().includes("out of memory"). No src/ changes.

Security risks

None. Env-var overrides on test subprocesses; no auth, crypto, network exposure, or user-input parsing is touched.

Level of scrutiny

Low. This is CI-hygiene: the mechanism (runner exports BUN_CRASH_REPORT_URL, drains /traces only on non-zero exit, deliberate crashes leak reports onto the next failing test) is well-documented in the PR description with three concrete build numbers showing the misattribution. The fix is the minimal, targeted one — clear the URL at each deliberate-crash spawn — and each existing assertion is preserved.

Other factors

I raised two points on earlier revisions and both were applied: the tls-syscall-fault.test.ts sibling now has the same env override (46639f6), and the OOM assertion was made SHOW_CRASH_TRACE-independent (af952f5). Both threads are resolved. The automatic crash reporter and raise ignoring panic handler tests correctly remain untouched since they self-host the report URL. The bug-hunting pass found nothing on the current revision. Latest commit is a no-op CI retrigger.

@robobun

robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

CI status on the three files in this diff: green on every executed lane across build 72166 and build 72190, including :darwin: 26 aarch64 (the original failing lane).

Build 72190 surfaced a real gap in this PR: the inline Bun.$ shell-prefix BUN_CRASH_REPORT_URL="" did not reach the bun run build.ts child on macOS release (the crash still printed the CI remap server URL), so the native-plugin segfault leaked and got pinned on fetch-leak.test.ts. 99e8774 switches that spawn to .env({...bunEnv, ...}), matching the file's existing convention and bypassing shell parsing.

Remaining CI red on 72166/72190 is unrelated to this diff and already owned elsewhere:

…-report suppression

Build 72190 shows the inline shell-syntax override did not reach the
child on macOS release (the crash still printed the CI remap server
URL). Switch to .env({...bunEnv, ...}) which sets the spawn env
directly and matches this file's existing convention.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — both earlier review rounds are addressed (tls-syscall-fault sibling now suppresses reporting, OOM matcher is phrasing-agnostic), and 99e8774 moves the native-plugin override to .env() so it actually reaches the child.

What was reviewed:

  • Confirmed the three noReportEnv swaps only touch spawns that don't assert on upload; the two tests that self-host a report server still set their own BUN_CRASH_REPORT_URL.
  • .env({...bunEnv, ...}) on the Bun.$ call matches the file's existing convention and preserves BUN_TEST_TEMP_DIR; no cwd or other env was dropped vs. the original inline form.
  • bunEnv is a plain object literal in harness, so the module-scope { ...bunEnv, ... } spread is fine.
Extended reasoning...

Overview

Test-only env-var overrides on five subprocess spawns across three files, so deliberate-crash fixtures stop POSTing to CI's crash-remap server (which was pinning spurious "crash reported" errors on unrelated later tests). run-crash-handler.test.ts swaps three env: bunEnv for a shared noReportEnv; native-plugin.test.ts moves one Bun.$ spawn to .env({...bunEnv, BUN_CRASH_REPORT_URL: "", BUN_ENABLE_CRASH_REPORTING: "0"}); tls-syscall-fault.test.ts gets the same override plus a phrasing-agnostic OOM matcher. No src/ changes.

Security risks

None. Adds two env vars to child-process spawns inside the test suite; no new inputs, no external network, no auth/crypto surface.

Level of scrutiny

Low. Mechanical test-harness change with a clearly documented CI-attribution root cause. Worst-case regression is a test-file failure, which CI would catch immediately — and per the thread, the three touched files are green on builds 72166/72190 including the originally failing lane.

Other factors

This is my third pass on the PR. Both prior comments (missed tls-syscall-fault sibling; over-specific OOM phrasing after that fix) were applied in 46639f6 and af952f5 and are marked resolved. The final commit 99e8774 fixes a real gap surfaced by CI (inline shell VAR= prefix didn't reach the grandchild on macOS release) by switching to .env(), which is the pattern the rest of the file already uses. I verified bunEnv is a plain module-scope object so spreading it at module load in noReportEnv is safe, and that the two report-server tests in run-crash-handler.test.ts still point at their own local server. No outstanding reviewer comments.

@robobun

robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Another instance: build 72253 flagged test/js/node/test/parallel/test-http-agent-scheduling.js as "crash reported" on darwin 26 aarch64 with 4 stale invoked crashByPanic() traces from run-crash-handler.test.ts. The test's own one-off flake (a mustCallAtLeast mismatch) would normally have been retried, but the inherited traces upgraded it to isAlwaysFailure and blocked the retry.

@robobun

robobun commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator Author

Another instance: build 72281 flagged test/js/node/test/parallel/test-http2-compat-serverresponse-end.js as "crash reported" on darwin 26 aarch64 with the same 4 stale traces (2x crashByPanic, OOM, 0xDEADBEEF segfault). Underlying failure was a single NGHTTP2_FRAME_SIZE_ERROR flake (0 hits across 260 neighboring builds, 0/200 local stress runs) that would have been retried away; the build was canceled before any retry could run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants