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 9h 37m ago, live in production
scout/forge:scout/17740-flaky-test-no-first-page-s-client-javasc → main 0 commits fork 2 threads · 2 unresolved
1 file
changed +14
−4
test/client-size.test.ts +14 −4
| @@ -84,12 +84,21 @@ afterAll(() => { | ||
| 84 | 84 | rmSync(root, { recursive: true, force: true }); |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | /** | |
| 88 | * A refusal that says what it was: the check's log keeps only a line, and this test flaked on one | |
| 89 | * (#17740). | |
| 90 | */ | |
| 91 | function refused(what: string, res: Response, body: string): string { | |
| 92 | return `${what} answered ${res.status} (retry-after ${res.headers.get("retry-after") ?? "none"}): ${JSON.stringify(body.slice(0, 200))}`; | |
| 93 | } | |
| 94 | ||
| 87 | 95 | async function render(b: (typeof PAGE_BUDGETS)[number]): Promise<string> { |
| 88 | 96 | const res = await fetch(`${servers.url}${pagePath(b, "alice", "notes")}`, { |
| 89 | 97 | headers: b.signedOut ? { "accept-encoding": "identity" } : { cookie, "accept-encoding": "identity" }, |
| 90 | 98 | }); |
| 91 | if (res.status !== 200) throw new Error(`${b.pattern} answered ${res.status}`); | |
| 92 | return res.text(); | |
| 99 | const html = await res.text(); | |
| 100 | if (res.status !== 200) throw new Error(refused(b.pattern, res, html)); | |
| 101 | return html; | |
| 93 | 102 | } |
| 94 | 103 | |
| 95 | 104 | async function measure(): Promise<{ sizes: Ceilings; drift: string[] }> { |
| @@ -100,8 +109,9 @@ async function measure(): Promise<{ sizes: Ceilings; drift: string[] }> { | ||
| 100 | 109 | drift.push(...inlineDrift(`${b.pattern} (${b.page})`, html, await render(b))); |
| 101 | 110 | sizes[b.pattern] = await clientSize(html, async (path) => { |
| 102 | 111 | const asset = await fetch(`${servers.url}${path}`, { headers: { "accept-encoding": "identity" }, redirect: "follow" }); |
| 103 | if (asset.status !== 200) throw new Error(`${path} answered ${asset.status}`); | |
| 104 | return asset.text(); | |
| 112 | const body = await asset.text(); | |
| 113 | if (asset.status !== 200) throw new Error(refused(path, asset, body)); | |
| 114 | return body; | |
| 105 | 115 | }); |
| 106 | 116 | } |
| 107 | 117 | return { sizes, drift }; |
new above
offline
A fixed
Bun.sleepin a loop is a wall-clock wait on state that has no hook.real-timer:silences the gate but does not make the wait deterministic. Await the live work in setup (warm the highlighter bundle, let the pull's checks finish) so that a first pair of renders is already stable. Also,drift.push(...found)now reports only the last attempt, so the header's 'identical on every run' guarantee is weaker and the file header (lines 1-9) needs updating.