Repository navigation
Conversation
No test asserted these counts: - --rerun-each: an error outside a test counts on every run, a file that fails to load counts once. - exit code 1 when the only failure is an error outside a test. - --parallel: files left when no worker starts count as failed.
…il_file The two counters that fail a run, Summary.fail and the count of errors outside a test, become private fields of Summary inside a small module in jest.rs. The count of errors moves from TestRunner into Summary. Three writers remain: - count_failed_test, for a finished test. - merge_worker_counts, for the totals a --parallel worker sends for a file. The records of those failures arrive as TestDone frames. - fail_file(kind, site, detail), for a load failure, an error outside a test, a crashed worker, a file aborted by a worker panic and a file no worker took. It counts what the kind counts and then hands the record to the reporter. The six sites that counted such a failure and recorded it themselves now call fail_file. A file no worker took is the one kind with no record. Console output and the JUnit document do not change.
|
Updated 3:02 AM PT - Oct 2nd, 2026
❌ @robobun, your commit 251204b has 1 failures in
🧪 To try this PR locally: bunx bun-pr 44436That installs a local version of the PR into your bun-44436 --bun |
|
Status: draft. Last PR of a stack: #44434, #44435, #44436 (this one). It is optional and changes no output. It needs a maintainer's yes to the chokepoint ( How I checked it: stdout, stderr, the JUnit XML and the exit code equal #44435 on 8 fixtures (230 stderr lines, 8,812 XML bytes). |
|
Closing: one PR in place of the stack. This refactor is optional and changes no output. The branch |
Behaviour change: none
Problem
src/runtime/test_runner/jest.rs:145,:267), so a new site can count and record nothing. Four sites did that before bun test --reporter=junit: record a failure that is not a finished test #44435.Fix
Summary, in a module injest.rs. Three writers remain:count_failed_test,merge_worker_countsandfail_file(kind, site, detail).fail_filecounts what the kind counts, then records it. The six sites call it. A file no worker took is the one kind with no record.Background
Summaryholds the totalsbun testprints.failand the count of errors outside a test decide exit code 1.--parallel, a coordinator hands files to workers. It counts a file itself only when the worker cannot send its totals.REVIEW.mdasks for agreement before a new cross-module abstraction. Close it if bun test --reporter=junit: record a failure that is not a finished test #44435 is enough.Downsides
Summarygrows from 28 to 32 bytes.size).Notes
FileFailurecounts:Loadadds 1 tofail, and 1 to the errors outside a test when the rejection was printed as an unhandled error.DescribeCallbackandUnhandledadd 1 to the errors outside a test.WorkerCrashed,AbortedandNotDispatchedadd 1 tofail.NotDispatchedhas no testcase, so a runner that reads the report runs the file again (ci: run the fast, non-flaky test files as onebun test --parallelbatch per shard #36175).describe) run plain, with--rerun-each=2and with--bail=1. A worker that exits under--parallel=2. A worker panic under--parallel=2. Two good files under--parallel=2. Two files that both fail to load. A hook that leaks a rejection. Durations, the hostname and the version were masked. Result: 8 stdout lines, 230 stderr lines, 8,812 XML bytes and 8 exit codes, all equal.--reporter=junit, 1,922 in a--parallelworker. The count is the number of guest instructions qemu-user executes inside the functions of the test runner, for 1,100 empty tests minus 100, divided by 1,000.perfandvalgrindare not installed on the machine I used.describeblocks, 10,827 for 200 unhandled errors.size): 80,713,299 before, 80,713,043 after.self.reporter.summary().fail += 1inCoordinator.rsfails with E0616.--rerun-eachcounts, exit code 1 for an error outside a test, and the counts when no worker starts.junit.test.js,parallel-non-test-failures.test.ts,runner-junit.test.ts,parallel-startup-failure.test.ts,26851.test.ts,bun_test.test.ts,test-test.test.ts.parallel.test.tswith--timeout 120000: 43 pass, 2 fail. Both are timing tests (work-stealing balances an uneven directory split,each worker has a unique JEST_WORKER_ID and BUN_TEST_WORKER_ID). The machine had a load average above 300. On a release build: 44 pass, 1 fail (--parallel --dots prints one status character per test, which fails in 4 of 8 runs on main and in 2 of 8 here).