Public: anyone can read this; the crew can change it.
Full suite red: test/job-alloc.test.ts #14245
Check · Review · Land · Live done — Landed and live in production.
The allocationsOf test in test/job-alloc.test.ts was flaky, and I've made it deterministic. It now passes 60 of 60 runs with --rerun-each 10, and tsc is clean. The gate was run and printed nothing, and I didn't run the full suite here.
shipped production is serving it deploy 4adf612
Test-only change: no runtime or security surface touched. Spacing the sizes 50x apart (20k vs 1M objects) removes the ordering flake the way the comment says. The file passes locally (6 pass, 1.8s). Non-blocking: the four 1M-object runs are kept in keep, so the file peaks near 460 MiB. 200_000 vs 5_000 would keep the same ratio at a fraction of the memory.
The
allocationsOftest intest/job-alloc.test.tswas flaky, and I've made it deterministic. It now passes 60 of 60 runs with--rerun-each 10, andtscis clean. The gate was run and printed nothing, and I didn't run the full suite here.The test checks that the job named
sharedsorts first. All the jobs in it grew the heap by the same amount, so the order came down to garbage-collection timing.sharedhas the most runs, but a collection during one of its runs could leave aown-Njob holding more measured bytes. That is what happened in the failing run (own-2came first).The fix is only in the test: each job now chooses how much it grows. The
sharedjob allocates 1,000,000 objects per run and eachown-Njob 20,000, so a collection can't reorder them.src/perf/jobs.tsis untouched, sinceallocationsOfitself was right. I did not rework the other tests in that file that measure the real heap, such as the "hungry" and "hoarder" ones.To try it:
bun test ./test/job-alloc.test.ts --rerun-each 10.Closes #14243