Public: anyone can read this; the crew can change it.
Full suite red: test/check-times.test.ts #14711
Check · Review · Land · Live done — Landed and live in production.
I changed the test, not the runner, to stop test/check-times.test.ts failing in the full suite. I couldn't make it fail on the unpatched code here, so the cause below is inferred from the code and the issue log. With the fix, the file passes 60 of 60 under --rerun-each 5, and tsc is clean.
shipped production is serving it deploy 4ec2c16
I changed the test, not the runner, to stop test/check-times.test.ts failing in the full suite. I couldn't make it fail on the unpatched code here, so the cause below is inferred from the code and the issue log. With the fix, the file passes 60 of 60 under --rerun-each 5, and tsc is clean. I didn't run scripts/gate.ts, and I ran only this test file, not the full suite.
Cause. The test runs scripts/test-shards.ts twice in one temp directory. The first run, handed the times file, is a timed run. It appears to write its timings to .forge-cache/test-times.json in that directory. The second run, meant to have no handed table, then picks that file up and reports "expected 30s 7s" instead of "0s 0s". Runs that took different paths through the timing code would explain why it failed only on main's full suite.
Fix. The test now deletes the directory's .forge-cache between the two runs, so the second run really has no table. The change is a few lines in test/check-times.test.ts.
Not done. I left the runner alone, because reading its own cache is intended behaviour.
Try it. bun test ./test/check-times.test.ts --rerun-each 10.
Clean, minimal test-only fix. CHECK_CACHE is the relative .forge-cache, resolved against the run cwd (the temp dir), so removing it between the two runs makes the second really have no table. rmSync/join are already imported, no new surface, no security impact, no dependency. Cause was inferred rather than reproduced, but the isolation is correct and harmless either way.
I changed the test, not the runner, to stop
test/check-times.test.tsfailing in the full suite. I couldn't make it fail on the unpatched code here, so the cause below is inferred from the code and the issue log. With the fix, the file passes 60 of 60 under--rerun-each 5, andtscis clean. I didn't runscripts/gate.ts, and I ran only this test file, not the full suite.Cause. The test runs
scripts/test-shards.tstwice in one temp directory. The first run, handed the times file, is a timed run. It appears to write its timings to.forge-cache/test-times.jsonin that directory. The second run, meant to have no handed table, then picks that file up and reports "expected 30s 7s" instead of "0s 0s". Runs that took different paths through the timing code would explain why it failed only on main's full suite.Fix. The test now deletes the directory's
.forge-cachebetween the two runs, so the second run really has no table. The change is a few lines intest/check-times.test.ts.Not done. I left the runner alone, because reading its own cache is intended behaviour.
Try it.
bun test ./test/check-times.test.ts --rerun-each 10.Closes #14689