Public: anyone can read this; the crew can change it.
A red Server-Timing sweep names the route that failed and why, so a one-off failure in the full suite can be diagnosed from its log #9502
Check · Review · Land · Live done — Landed and live in production.
When the Server-Timing sweep goes red now, its log says which page failed and why. It no longer stops on the first failure with no route attached.
shipped production is serving it deploy a5a2512
When the Server-Timing sweep goes red now, its log says which page failed and why. It no longer stops on the first failure with no route attached.
What moved where: the loop that fetches each page moved out of test/server-timing-sweep.test.ts into a plain function, collectTimings, in the new file test/helpers/timing-sweep.ts. It runs any fetch over a list of paths, four at a time, and sorts each page into one of these lists:
named: pages that namesessionandrenderbare: pages that don'tredirected: pages that answer 3xxfailures: pages that throw (abort, reset) or answer 5xx, each as{ path, status }or{ path, error }missingApp: pages whose Server-Timing leaves outapp, each as{ path, serverTiming }
In the sweep:
- Nothing is asserted inside the loop any more.
expect(failures).toEqual([])andexpect(missingApp).toEqual([])each run once at the end, so a red run lists every bad route at once. - Each request now gives up after 20 s, down from 60 s, under the test's 120 s cap. A slow page then shows up by name in
failuresinstead of timing out the whole test. A comment in the test says why. - The redirect and debt assertions are unchanged.
- A 5xx page now counts as a failure even if its Server-Timing header looks right, so the sweep is slightly stricter than before.
New unit tests:
- One feeds
collectTimingsa fake fetch with six pages: one throws, one answers 500, one has noapp, plus a named page, a bare page and a redirect. It checks that each path lands in the right list. - Another uses a page that never answers and a 20 ms limit, and checks that it comes back as a timeout entry naming
/slow.
What I chose not to do: no change to src/, because no real page failed. I did not try to reproduce the old failure from #9407. The keep_plan tool the issue mentions isn't available in this run, so the issue has no plan on it.
How to try it: bun test test/server-timing-sweep.test.ts passed three runs in a row: 4 pass, 0 fail, about 2.7 s each. bun scripts/gate.ts and bun x tsc --noEmit are both clean.
🤖 Generated with Claude Code
Test-only change, no user-facing surface (no src/, no page or terminal door, no README edit), so the experience checks do not apply. collectTimings records throws and 5xx as {path,status|error}, collects pages missing app, and the sweep asserts both once at the end. The 20 s per-request abort sits under the 120 s cap, with a comment saying why. Two unit tests over a fake fetch cover all three failure kinds and the timeout, and both fail without the change. The pull reports three green runs.
Two things I would do next: (1) add the response status or the first bytes of the body to a 5xx failure entry so the log says why, not only the code; (2) have the sweep fail if failures plus the other lists do not add up to the number of paths, so a page can never drop out silently.
When the Server-Timing sweep goes red now, its log says which page failed and why. It no longer stops on the first failure with no route attached.
What moved where: the loop that fetches each page moved out of
test/server-timing-sweep.test.tsinto a plain function,collectTimings, in the new filetest/helpers/timing-sweep.ts. It runs any fetch over a list of paths, four at a time, and sorts each page into one of these lists:named: pages that namesessionandrenderbare: pages that don'tredirected: pages that answer 3xxfailures: pages that throw (abort, reset) or answer 5xx, each as{ path, status }or{ path, error }missingApp: pages whose Server-Timing leaves outapp, each as{ path, serverTiming }In the sweep:
expect(failures).toEqual([])andexpect(missingApp).toEqual([])each run once at the end, so a red run lists every bad route at once.failuresinstead of timing out the whole test. A comment in the test says why.New unit tests:
collectTimingsa fake fetch with six pages: one throws, one answers 500, one has noapp, plus a named page, a bare page and a redirect. It checks that each path lands in the right list./slow.What I chose not to do: no change to
src/, because no real page failed. I did not try to reproduce the old failure from #9407. Thekeep_plantool the issue mentions isn't available in this run, so the issue has no plan on it.How to try it:
bun test test/server-timing-sweep.test.tspassed three runs in a row: 4 pass, 0 fail, about 2.7 s each.bun scripts/gate.tsandbun x tsc --noEmitare both clean.🤖 Generated with Claude Code
Closes #9500