diff --git a/test/bundler/native-plugin.test.ts b/test/bundler/native-plugin.test.ts index 1287bcc28de..8bc704864e3 100644 --- a/test/bundler/native-plugin.test.ts +++ b/test/bundler/native-plugin.test.ts @@ -453,7 +453,12 @@ const many_foo = ["foo","foo","foo","foo","foo","foo","foo"] `; await Bun.$`echo ${build_code} > build.ts`; - const { stdout, stderr } = await Bun.$`BUN_TEST_TEMP_DIR=${tempdir} ${bunExe()} run build.ts`.throws(false); + // BUN_CRASH_REPORT_URL="": this segfault is deliberate; uploading it to + // CI's remap server pins a spurious "crash reported" error on the next + // unrelated failing test (runner only drains /traces on non-zero exit). + const { stdout, stderr } = await Bun.$`${bunExe()} run build.ts` + .env({ ...bunEnv, BUN_TEST_TEMP_DIR: tempdir, BUN_CRASH_REPORT_URL: "", BUN_ENABLE_CRASH_REPORTING: "0" }) + .throws(false); const errorString = stderr.toString(); expect(errorString).toContain('\x1b[31m\x1b[2m"native_plugin_test"\x1b[0m'); }); diff --git a/test/cli/run/run-crash-handler.test.ts b/test/cli/run/run-crash-handler.test.ts index 882cd7bdde6..dcff2e6ce68 100644 --- a/test/cli/run/run-crash-handler.test.ts +++ b/test/cli/run/run-crash-handler.test.ts @@ -4,6 +4,11 @@ import { bunEnv, bunExe, isDebug, isLinux, isPosix, mergeWindowEnvs } from "harn import path from "path"; const { getMachOImageZeroOffset } = crash_handler; +// CI sets BUN_CRASH_REPORT_URL so unexpected crashes are captured; these +// deliberate crashes must not upload there or the runner pins them on the +// next unrelated failing test as "crash reported" and blocks its retries. +const noReportEnv = { ...bunEnv, BUN_CRASH_REPORT_URL: "", BUN_ENABLE_CRASH_REPORTING: "0" }; + // On Linux, debug builds symbolize crash traces by spawning llvm-symbolizer; // without it the fallback printer has no Rust symbol names to assert on. const hasSymbolizer = !!(Bun.which("llvm-symbolizer") || Bun.which("llvm-symbolizer-21")); @@ -13,7 +18,7 @@ test.if(isDebug && isLinux && hasSymbolizer)( async () => { await using proc = Bun.spawn({ cmd: [bunExe(), path.join(import.meta.dir, "fixture-crash.js"), "panic"], - env: bunEnv, + env: noReportEnv, stdio: ["ignore", "pipe", "pipe"], }); // The panic header goes to stderr; the symbolized frames are printed by @@ -58,7 +63,7 @@ test.if(isPosix)( // spawning llvm-symbolizer, which can take tens of seconds. "--debug-crash-handler-use-trace-string", ], - env: bunEnv, + env: noReportEnv, stdio: ["ignore", "pipe", "pipe"], }); @@ -101,7 +106,7 @@ describe.if(isPosix)("terminal signal reflects the crash cause", () => { approach, "--debug-crash-handler-use-trace-string", ], - env: bunEnv, + env: noReportEnv, stdio: ["ignore", "pipe", "pipe"], }); const [stdout, stderr, exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]); diff --git a/test/js/node/tls/tls-syscall-fault.test.ts b/test/js/node/tls/tls-syscall-fault.test.ts index b7a518aff52..8eab4622d39 100644 --- a/test/js/node/tls/tls-syscall-fault.test.ts +++ b/test/js/node/tls/tls-syscall-fault.test.ts @@ -20,21 +20,22 @@ afterEach(() => fault.clear()); // stream; anything past "ARMED" means a TLS socket survived the failed // allocation and reached its read loop. const OOM_FIXTURE_MARKERS = ["ARMED", "READ DATA", "CLOSED", "CLIENT ERROR"]; -// How `CrashReason::OutOfMemory` is phrased depends on whether a crash report is -// being generated, and CI configures that per job (BUN_CRASH_REPORT_URL is only -// set when its remap server came up). Match either phrasing. -const OOM_CRASH_MESSAGES = ["Bun ran out of memory", "Bun has run out of memory"]; test.skipIf(!fault.available())( "a failed per-loop TLS buffer allocation reports out of memory instead of faulting inside SSL_read", async () => { await using proc = Bun.spawn({ cmd: [bunExe(), join(import.meta.dir, "tls-loop-buffer-oom-fixture.ts")], - env: bunEnv, + // BUN_CRASH_REPORT_URL="": this OOM is deliberate; uploading it to CI's + // remap server would pin a spurious "crash reported" error on the next + // unrelated failing test. + env: { ...bunEnv, BUN_CRASH_REPORT_URL: "", BUN_ENABLE_CRASH_REPORTING: "0" }, stdout: "pipe", stderr: "pipe", }); const [stdout, stderr] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]); - const outOfMemory = OOM_CRASH_MESSAGES.some(message => stderr.includes(message)); + // `CrashReason::OutOfMemory` phrasing varies with SHOW_CRASH_TRACE, so + // match the shared substring (see run-crash-handler.test.ts). + const outOfMemory = stderr.toLowerCase().includes("out of memory"); expect({ markers: stdout .split("\n")