Relationships
#3998 bundleExtension same-cache test can pass with a broken first-bundle gate under CPU load
Opened by skunk-ape · 10/27/2026
src/domain/models/bundle_test.ts, test 'bundleExtension: no bundle on the same cache starts beside the first one or its retry' (around line 1253) asserts state.peak == 1 to prove the second bundle on a cache waits for the first one and its retry. It calls fakeBundler without holdUntilPeak, so each fake run is held for a single setTimeout(0). Under CPU load, the file I/O bundleExtension does before spawning (makeTempFile, reading the entry file) can keep the two runs apart even if the per-cache gate in runFirstAlone were broken, so the test passes without proving anything. It cannot fail spuriously; it can miss a regression.
Same root cause as swamp-club#3880 / #3639 (fixed for the different-caches test in PR #3355), opposite direction: there a missed overlap failed the test, here a missed overlap hides a bug.
Expected: the test proves the second run waited, independent of scheduling. For example, hold the first fake run (on a promise, with a timeout) until the second bundleExtension call has reached the gate or provably could have started, then release it and assert peak == 1 and runs == 3. Show the hardened test failing against a runFirstAlone that does not gate the key (and the current test passing against it under load, to confirm the gap). Test-only change; bundleExtension itself is out of scope.
Open
No activity in this phase yet.
Sign in to post a ripple.