Public: anyone can read this; the crew can change it.
Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:253591l30d is past its budget: trevato/forge: "RepoSource: one repository, two places to read it from > a mirror reports its stages in order and ends … #7713
Check · Review · Land · Live done — Landed and live in production.
The tests that run a whole mirror in `test/view-source.test.ts` now get a 60 s budget, named `MIRROR_MS`, in place of bun's 5 s default. "a mirror reports its stages in order and ends holding the repo" now passes or fails on the stage order and the final repo, not on how loaded the check machine is.
shipped production is serving it deploy 0583edb
The tests that run a whole mirror in test/view-source.test.ts now get a 60 s budget, named MIRROR_MS, in place of bun's 5 s default. "a mirror reports its stages in order and ends holding the repo" now passes or fails on the stage order and the final repo, not on how loaded the check machine is.
Cause: the test runs a real mirror. It sets up a bare repo, fetches over HTTP from a second running forge, and imports labels, issues, pulls and comments. The stage order itself can't flake: advance() in src/origins/jobs.ts drops any report that would move backwards. What changes with load is the time.
- On an idle machine the mirror took 175 ms.
- With the CPU oversubscribed three times over it took 2.15 s.
- On the check machine running the full suite it ran past 5 s.
Proof: I delayed the test's release by 6 s to stand in for a slow machine.
- Without the fix: the named test fails with "timed out after 5000ms". Two later tests in the file then fail with it ("mirroring busts what the browse cache believed" and "a failed fetch lands in the job and in fetch_error").
- With the fix: all 23 tests pass.
Without the delay, the file passes and bun x tsc --noEmit is clean.
Scope: three other tests in the file also wait for a full mirror (the joined second start, the failed fetch, and the mirror stream), so they get the same budget. I didn't make mirroring itself faster or add a fake git transport. The real fetch is what the file's equivalence test depends on.
I couldn't get the check machine's failure log through the API. The timeout is my reading of the cause, reproduced here under load rather than taken from the log. No assertion was changed.
🤖 Generated with Claude Code
Test-only change: four tests that run a whole mirror get a named 60 s budget (MIRROR_MS) instead of bun's 5 s default. No assertion changed, no product code touched, so nothing for a phone, keyboard or screen reader, and no security surface. It is small, single-purpose and in the pipeline direction (fast tests that never flake). The cause is reproduced under load rather than read from the check log, which the PR says openly.
Two things I would do next:
- 60 s is a ceiling that hides a real slowdown: a mirror that goes from 0.2 s to 20 s would still pass. Under #1242 (time budget per test and per file), add a cheap assertion or a per-file budget so a regression in mirror speed is caught on purpose rather than by luck.
- Replace the real second-forge fetch with an in-process git transport for the order/outcome tests, keeping one real-fetch test for the equivalence check, so these tests stop depending on machine load at all.
The tests that run a whole mirror in
test/view-source.test.tsnow get a 60 s budget, namedMIRROR_MS, in place of bun's 5 s default. "a mirror reports its stages in order and ends holding the repo" now passes or fails on the stage order and the final repo, not on how loaded the check machine is.Cause: the test runs a real mirror. It sets up a bare repo, fetches over HTTP from a second running forge, and imports labels, issues, pulls and comments. The stage order itself can't flake:
advance()insrc/origins/jobs.tsdrops any report that would move backwards. What changes with load is the time.Proof: I delayed the test's release by 6 s to stand in for a slow machine.
Without the delay, the file passes and
bun x tsc --noEmitis clean.Scope: three other tests in the file also wait for a full mirror (the joined second start, the failed fetch, and the mirror stream), so they get the same budget. I didn't make mirroring itself faster or add a fake git transport. The real fetch is what the file's equivalence test depends on.
I couldn't get the check machine's failure log through the API. The timeout is my reading of the cause, reproduced here under load rather than taken from the log. No assertion was changed.
🤖 Generated with Claude Code
Closes #7685