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

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

torque/forge:torque/13805-pulls-that-each-fit-a-shared-budget-cann → main 2 commits fork 1 thread · 1 unresolved

  • Merged. torque/13805-pulls-that-each-fit-a-shared-budget-cann was merged into main as 8e7d2b1.

Review

Sign in to review this change.
2 files changed +12 −0
src/checks/tiers.ts +3
@@ -49,6 +49,9 @@ export const RULE_TESTS: readonly string[] = [
4949 "test/release-boot.test.ts",
5050 // No process-wide state a request writes to: it belongs to an app (#12569).
5151 "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",
5255 ];
5356
5457 /** What a test the times table does not name is assumed to take. */
test/client-size.test.ts +9
@@ -5,6 +5,8 @@
55 * plus headroom (2 %, up to the next 256 B: `ceilingFor`, #12040); raising one
66 * needs a note in the pull. Each page is rendered twice and its counted inline
77 * 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).
810 */
911 import { afterAll, beforeAll, expect, test } from "bun:test";
1012 import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
@@ -17,6 +19,7 @@ import { getRepo } from "../src/core/repos.ts";
1719 import { createUser } from "../src/core/users.ts";
1820 import { serve, type Servers } from "../src/http/server.ts";
1921 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";
2023 import { PAGE_BUDGETS, pagePath } from "../src/perf/page_budget.ts";
2124 import { mintClaim } from "../src/spawn/claim.ts";
2225 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",
163166 const size = await clientSize(html, async (p) => (p.endsWith(".js") ? "x".repeat(1000) : "y{z:1}".repeat(100)));
164167 expect(size).toEqual({ js: gz("x".repeat(1000)) + gz("let a=1;"), css: gz("y{z:1}".repeat(100)) + gz("b{c:d}") });
165168 });
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");

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.

174 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs