diff --git a/test/no-validate-leaksan.txt b/test/no-validate-leaksan.txt index ced62fed9913..32a677be1b1f 100644 --- a/test/no-validate-leaksan.txt +++ b/test/no-validate-leaksan.txt @@ -95,6 +95,9 @@ test/cli/install/bun-install-security-provider.test.ts test/js/node/test/parallel/test-tls-fast-writing.js test/js/bun/sqlite/sqlite.test.js test/regression/issue/12250.test.ts +# `bun test --bail` exits with a bare exit(1), so the VM teardown is skipped and +# LeakSanitizer aborts the child with 134 after several seconds (#32183). +test/regression/issue/26851.test.ts test/js/bun/test/parallel/test-http-10177-response.write-with-non-ascii-latin1-should-not-cause-duplicated-character-or-segfault.ts test/cli/install/minimum-release-age.test.ts diff --git a/test/regression/issue/26851.test.ts b/test/regression/issue/26851.test.ts index c3a07909788e..691a5b2da34e 100644 --- a/test/regression/issue/26851.test.ts +++ b/test/regression/issue/26851.test.ts @@ -1,77 +1,105 @@ +// https://github.com/oven-sh/bun/issues/26851 +// `bun test --bail --reporter=junit --reporter-outfile=` must still write +// the JUnit file when --bail stops the run. import { expect, test } from "bun:test"; -import { bunEnv, bunExe, tempDir } from "harness"; +import { bunEnv, bunExe, normalizeBunSnapshot, tempDir } from "harness"; import { join } from "path"; -test("--bail writes JUnit reporter outfile", async () => { - using dir = tempDir("bail-junit", { - "fail.test.ts": ` - import { test, expect } from "bun:test"; - test("failing test", () => { expect(1).toBe(2); }); - `, - }); +const passing = (name: string) => + `import { test, expect } from "bun:test";\ntest(${JSON.stringify(name)}, () => { expect(1).toBe(1); });\n`; +const failing = (name: string) => + `import { test, expect } from "bun:test";\ntest(${JSON.stringify(name)}, () => { expect(1).toBe(2); });\n`; + +// The hostname and the time attributes differ per run. Everything else is stable. +function normalizeJUnit(xml: string) { + return xml.replace(/ time="[^"]*"/g, ' time="