Public: anyone can read this; the crew can change it.
Pulls that each fit a shared budget cannot land together over it: the size ceilings went red on main for hours #13809
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/13805-pulls-that-each-fit-a-shared-budget-cann → main 2 commits fork 1 thread · 1 unresolved
2 files
changed +12
−0
src/checks/tiers.ts +3
| @@ -49,6 +49,9 @@ export const RULE_TESTS: readonly string[] = [ | ||
| 49 | 49 | "test/release-boot.test.ts", |
| 50 | 50 | // No process-wide state a request writes to: it belongs to an app (#12569). |
| 51 | 51 | "test/module-state.test.ts", |
| 52 | // The first-page byte ceilings are one budget every pull spends from (#13805): | |
| 53 | // six pulls each under it alone put main over it. Any pull's check measures it. | |
| 54 | "test/client-size.test.ts", | |
| 52 | 55 | ]; |
| 53 | 56 | |
| 54 | 57 | /** What a test the times table does not name is assumed to take. */ |
test/client-size.test.ts +9
| @@ -5,6 +5,8 @@ | ||
| 5 | 5 | * plus headroom (2 %, up to the next 256 B: `ceilingFor`, #12040); raising one |
| 6 | 6 | * needs a note in the pull. Each page is rendered twice and its counted inline |
| 7 | 7 | * code must be identical, so the verdict is the same on every run. |
| 8 | * @tree-scan: it measures the rendered stylesheet every page shares, so any diff can move it | |
| 9 | * (#13805). | |
| 8 | 10 | */ |
| 9 | 11 | import { afterAll, beforeAll, expect, test } from "bun:test"; |
| 10 | 12 | import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; |
| @@ -17,6 +19,7 @@ import { getRepo } from "../src/core/repos.ts"; | ||
| 17 | 19 | import { createUser } from "../src/core/users.ts"; |
| 18 | 20 | import { serve, type Servers } from "../src/http/server.ts"; |
| 19 | 21 | import { ceilingFor, ceilingsFor, clientSize, inlineDrift, sizeFindings, SIZE_WRITE_COMMAND, type Ceilings } from "../src/measure/client_size.ts"; |
| 22 | import { RULE_TESTS } from "../src/checks/tiers.ts"; | |
| 20 | 23 | import { PAGE_BUDGETS, pagePath } from "../src/perf/page_budget.ts"; |
| 21 | 24 | import { mintClaim } from "../src/spawn/claim.ts"; |
| 22 | 25 | import { quietLogs } from "./helpers/globals.ts"; |
| @@ -163,3 +166,9 @@ test("the count is gzip of linked and inline code, and leaves data blocks out", | ||
| 163 | 166 | const size = await clientSize(html, async (p) => (p.endsWith(".js") ? "x".repeat(1000) : "y{z:1}".repeat(100))); |
| 164 | 167 | expect(size).toEqual({ js: gz("x".repeat(1000)) + gz("let a=1;"), css: gz("y{z:1}".repeat(100)) + gz("b{c:d}") }); |
| 165 | 168 | }); |
| 169 | ||
| 170 | test("the size test runs in every pull's check; it measures that pull on its own base, not the merge (#13805)", () => { | |
| 171 | // Two pulls that each fit alone are both green and can still land over the ceiling: | |
| 172 | // this only makes each pull's own overshoot visible before it lands. | |
| 173 | expect(RULE_TESTS).toContain("test/client-size.test.ts"); | |
| 174 | }); |
new above
offline
Non-blocking: this is a membership pin only. Check whether test/rule-tests-always.test.ts already guarantees it, and drop the duplicate if it does.