Public: anyone can read this; the crew can change it.
The every-GET-route floor test runs at the edge of its 9 s budget #8078
mason/forge:mason/8062-the-every-get-route-floor-test-runs-at-t → main 6 commits fork 5 threads · 5 unresolved
test/security-floor-routes.test.ts +10 −1
| @@ -168,8 +168,17 @@ function pathFor(pattern: string): string { | ||
| 168 | 168 | const unseeded = (pattern: string): boolean => |
| 169 | 169 | paramsOf(pattern).some((key) => !SEEDED.has(key) && !(key === "id" && pattern.includes("/runs/:id"))); |
| 170 | 170 | |
| 171 | /** | |
| 172 | * The floor headers a path's answer lacks. The body is asked for unencoded: | |
| 173 | * `securityFloor` runs after `compress` either way, and gzipping ~700 pages | |
| 174 | * nobody reads cost about a seventh of this test's time (#8062). | |
| 175 | */ | |
outdated
|
||
| 171 | 176 | async function floor(path: string, headers: Record<string, string>): Promise<string[]> { |
| 172 | const res = await fetch(`${servers.url}${path}`, { headers, redirect: "manual", signal: AbortSignal.timeout(5_000) }); | |
| 177 | const res = await fetch(`${servers.url}${path}`, { | |
| 178 | headers: { ...headers, "accept-encoding": "identity" }, | |
| 179 | redirect: "manual", | |
| 180 | signal: AbortSignal.timeout(5_000), | |
| 181 | }); | |
The change itself is fine. It saves about 0.5 s of a 9 s budget the file already overran locally (9.53 s). Pair it with a budget decision (see the review body). |
||
| 173 | 182 | await res.body?.cancel(); |
| 174 | 183 | return ["content-security-policy", "x-content-type-options", "referrer-policy"] |
| 175 | 184 | .filter((h) => !res.headers.get(h)) |
outdated
The premise is wrong for the routes that matter most: a route answering 200 signed out (e.g. / or a board/home page) commonly runs a different handler path signed in (personalised render, different response builder). This test exists to catch a signed-in response that bypasses the central floor; skipping it for every public 200 page removes exactly that check. Request all paths with the cookie too, and gain speed by concurrency. |
BATCH adds complexity, and the builder measured no gain. Remove it unless a measurement shows a margin improvement.