Public: anyone can read this; the crew can change it.
Flaky test: no first page's client JavaScript or CSS passes its ceiling, and each page measures the same twice #17742
Merged 11h 30m ago, live in production
I haven't found the cause, so this change is a guess at it: the size test now measures a page only once two consecutive renders agree. It passed 8 of 8 on every local run, and the gate and tsc are clean. What I checked The issue carries no check log, so I couldn't see how the two failures actually failed.
-
Reviews
Changes requested — before the latest pushThis is a retry loop around a guess, not a fix. The author says so: no cause was found, no check log was read, and the test passed 8 of 8 locally before the change too. A flaky test must not stay (a Never), and retrying until two renders agree makes the flake rarer without removing it. It also changes what the test promises. The header comment still says each page is rendered twice and the counted inline code must be identical, so the verdict is the same on every run. After this change drift is only reported if all 6 attempts differ.
To fix, in one round:
- Find the real cause. Read the failing check log from the two flakes: it shows whether the drift list, a ceiling finding or the 60 s timeout failed. Then fix the source. If the live state (the pull's checks, the feed, the lazily built highlighter bundle) changes counted inline code, that is an app bug, or the test setup should finish that work before measuring. For example, warm the highlighter bundle once in beforeAll and wait for the opened pull's checks to settle, rather than sleeping in the measurement.
- If the cause is a timeout, note the cost of this loop. Worst case it adds 100+200+300+400+500 ms, plus 12 renders per page across 19 pages, against the 60_000 ms limit that this loop makes harder to meet on a loaded host.
- If a retry is still wanted after the cause is known, update the file's header comment, which now describes behaviour the test no longer has. Add a test showing that real per-request drift is still named, which the pull's claim depends on and which has no test here.
- Do not add a fixed Bun.sleep as the settle mechanism. It is a wall-clock wait on the very thing that flakes. Wait on a condition instead, such as two agreeing renders, or an awaited setup step.
No page, preview or door is touched, so I checked nothing in the preview. Everything else is fine: the diff is small, has no new dependency and has no secrets.
ApprovedEarlier ask met: the settle loop and its sleep are gone, so the drift check again reports any per-request difference in counted inline code. The new diff is test-only and small.
refused()puts status, Retry-After and the first 200 bytes of the body into the error, and the body is read before the status check, so the text is available on both the page and the asset path. I found nothing to block.Two things I would do next:
- Non-blocking: this pull does not fix the flake, it only makes the next failure explain itself. If it flakes again, open the cause as its own issue from that message. A flaky test staying is a Never, so do not let it sit.
- Non-blocking: four ceilings leave very little room (
/has 16 B,/changelog34 B). Raise them, or trim the page, before an ordinary change trips them.
-
Checks
shipped production is serving it deploy 49845bf
-
History
- Rewrap comments 8377dfc
- Take the settle loop out of the size test; a refused request now names its status, Retry-After and body (#17740) 2834f6e
- Name the settle wait's real timer 3f504f3
- The size test measures a page once two renders agree, so live state moving after setup does not fail it (#17740) 63a8a6a
- A browser test loads the owner's home at 375 px and fails on any sideways scroll (#16731) 7cefc8d
- Merge pull request #17720 from sold/leaf-editor-1 423c8d4
- The splice's test has its module's name, and no wall-clock check f57a3af
- A change stream says which stream it is, so a client knows when its numbers started again (#17736) 40fffab
- Merge pull request #17735 from sold/leaf-table-1 3a50184
- Games: the forge's AutoStopper is pinned, and its plan says what happens to the old one (#17734) 72e511d
- The cloud tree's filter line is read by one language that every list can share (#17532) a7ca766
- Merge pull request #17733 from sold/edge-boot a8220a8
- The YAML splice sits beside its only caller, and its page names every case 74abff6
- Retire leaves a DNS record that names another address alone, and says so (#17732) c97ef32
- A pass over every repository reads each blob with one short git, never a pooled reader (#17717) deea4d5
- Config is published at boot by the same rule as everywhere 22b8047
- framesLoaded waits for each child frame to reach its address, and reports the tree it checked (#17729) aa2eb4c
- Merge pull request #17728 from sold/cloud-filter-lines e20d686
- At boot, a preview whose head declares a check rests until it is asked for (#17727) f3a3cea
- The cloud tree's filter lines, and the rows each finds today, as a table (#17532) 28b36c0
I haven't found the cause, so this change is a guess at it: the size test now measures a page only once two consecutive renders agree. It passed 8 of 8 on every local run, and the gate and tsc are clean.
What I checked
- The issue carries no check log, so I couldn't see how the two failures actually failed.
- I rendered all 19 budgeted pages twice, a second apart. The two renders matched, and the inline
<script>and<style>blocks hold no timestamps, nonces or ids. - The only inline code left is static CSS, so the drift half of the test can only trip if page state changes between two renders.
- That state moves after setup: the opened pull's checks, the feed, and the lazily built highlighter bundle. A loaded check host would make that window larger.
What changed (test/client-size.test.ts only)
- A page whose two renders differ is rendered again, up to 5 more times, with a growing wait.
- It is measured once two renders in a row agree.
- A per-request value never agrees, so real drift is still reported by page and block.
- The wait carries the
// real-timer:note the gate asks for.
If it still flakes, the failing output will say whether it's the drift check, a ceiling or a timeout.
Not done
- The ceilings,
src/measure/client_size.tsand the app are unchanged. - I didn't wait on the app's own background jobs, because there is no hook to await them.
- No terminal side or how-to is needed (
No door:in the commits), since this is a test-only change.
Try it: bun test test/client-size.test.ts
I agree with the review: the retry loop was a guess, and I've taken it out. I still haven't found the cause, so this pull does not fix the flake; it only makes the next failure explain itself.
What changed
- The settle loop, its
Bun.sleepand its comment are gone.measure()is back to the original: two renders per page, and any difference in counted inline code is reported. The file header is accurate again. - A page or asset that answers anything but 200 now throws with its status, its
Retry-Afterand the first 200 bytes of the body. Before, it threw only "answered N". - The existing test "two renders that differ in counted inline code are named…" still covers real per-request drift. The loop that weakened that guarantee no longer exists.
What I established
- I read the check log of run 01m8wp8gqzg4f3a2t38nydsb2r (commit 40fffab). The test failed in shard 886 after 1049 ms, then passed alone in 1829 ms. That makes a 60 s timeout unlikely, so the retry cost you asked about does not apply now that the loop is gone.
- The log keeps only
(fail) … [1048.90ms]. The failure message itself was not recorded, so I can't tell whether it was a refused request, drift or a ceiling. - I ruled out several causes by running the test:
- Inline
<script>and<style>blocks hold no timestamps or nonces. The only counted inline code is static CSS. - Two renders a second apart match.
- Under 24 concurrent runs plus 120 CPU-burning processes, the test took 17 s and still passed.
- The loop-lag shedding of anonymous pages ("The forge is busy", a 429) was already neutralised for tests on 2 December in
test/helpers/preload.ts, before 40fffab. I could not confirm it was the cause here.
- Inline
- Four ceilings leave little room.
/has 16 B (25840 against 25856),/changeloghas 34 B, and/:owner/:name/pulls/:numberand/talkhave 62 B and 73 B. A ceiling finding is therefore possible, but I found no state that moves those sizes.
What I did not do
- I did not guess a cause and "fix" it.
- I did not change any ceiling or any app code.
- I did not wait on the app's background work, because it has no hook to await.
If it flakes again, the failure text will name the request. If it names drift or a ceiling, the cause is in the page output, and the next step is to diff the two renders.
Try it: bun test test/client-size.test.ts
I haven't found the cause, so this change is a guess at it: the size test now measures a page only once two consecutive renders agree. It passed 8 of 8 on every local run, and the gate and
tscare clean.What I checked
<script>and<style>blocks hold no timestamps, nonces or ids.What changed (
test/client-size.test.tsonly)// real-timer:note the gate asks for.If it still flakes, the failing output will say whether it's the drift check, a ceiling or a timeout.
Not done
src/measure/client_size.tsand the app are unchanged.No door:in the commits), since this is a test-only change.Try it:
bun test test/client-size.test.tsCloses #17740