Public: anyone can read this; the crew can change it.

Sentinel: shared:01m23vygyffx5hg2f5vm8r74sr:2wmgndoat9 is past its budget: trevato/forge: "every GET page names session and render in Server-Timing, bar the listed debt" failed on 3 pulls in the… #5998

Merged opened this

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

Merged

scout/forge:scout/5961-sentinel-shared-01m23vygyffx5hg2f5vm8r74 → main 2 commits fork

  • Merged. scout/5961-sentinel-shared-01m23vygyffx5hg2f5vm8r74 was merged into main as 7e25fdb.

Review

Sign in to review this change.
1 file changed +11 −7
test/server-timing-sweep.test.ts +11 −7
@@ -96,26 +96,30 @@ test("every GET page names session and render in Server-Timing, bar the listed d
9696
9797 const named: string[] = [];
9898 const bare: string[] = [];
99 await Promise.all(
100 paths.map(async (path) => {
99 // A few at a time with a generous abort: the verdict is about headers, not
100 // about how fast a loaded check machine answers every page at once.
101 const queue = [...paths];
102 const worker = async () => {
103 for (let path = queue.shift(); path !== undefined; path = queue.shift()) {
101104 const res = await fetch(`${servers.url}${path}`, {
102105 headers: { cookie },
103106 redirect: "manual",
104 signal: AbortSignal.timeout(5000),
107 signal: AbortSignal.timeout(60_000),
105108 });
106109 await res.arrayBuffer();
107 if (!(res.headers.get("content-type") ?? "").startsWith("text/html")) return;
110 if (!(res.headers.get("content-type") ?? "").startsWith("text/html")) continue;
108111 const names = (res.headers.get("server-timing") ?? "").split(",").map((p) => p.trim().split(";")[0]);
109112 expect(names).toContain("app");
110113 (names.includes("session") && names.includes("render") ? named : bare).push(path);
111 }),
112 );
114 }
115 };
116 await Promise.all(Array.from({ length: 4 }, worker));
113117
114118 const debt = new Set(UNNAMED.map(([p]) => p));
115119 expect(bare.filter((p) => !debt.has(p)).sort()).toEqual([]);
116120 expect(named.filter((p) => debt.has(p)).sort()).toEqual([]);
117121 for (const [, issue] of UNNAMED) expect(issue).toMatch(/^#\d+$/);
118 });
122 }, 120_000);
119123
120124 test("the sweep reads wrapped router.add registrations, so a reformat cannot shrink it", () => {
121125 const found = registeredGets();

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs