Public: anyone can read this; the crew can change it.
The HEAD-options sweep test is pinned on time, not on machine load #14710
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/14685-the-head-options-sweep-test-is-pinned-on → main 1 commit fork
1 file
changed +5
−0
test/head-options-sweep.test.ts +5
| @@ -14,6 +14,7 @@ import { createUser } from "../src/core/users.ts"; | ||
| 14 | 14 | import { setLimit } from "../src/settings/limits.ts"; |
| 15 | 15 | import { setStrangerLimits, strangerLimits } from "../src/http/strangers.ts"; |
| 16 | 16 | import { headOf, MEASURE_CAP } from "../src/http/head.ts"; |
| 17 | import { pinCrawlLag } from "../src/http/crawl.ts"; | |
| 17 | 18 | import { buildApiRouter, buildRouter, serve, type Servers } from "../src/http/server.ts"; |
| 18 | 19 | import { quietLogs } from "./helpers/globals.ts"; |
| 19 | 20 | import { pool } from "./helpers/sweep-clock.ts"; |
| @@ -29,6 +30,10 @@ beforeAll(async () => { | ||
| 29 | 30 | // A sweep of every route from one address is not a stranger to be throttled. |
| 30 | 31 | const per = strangerLimits(app).perAddress; |
| 31 | 32 | setStrangerLimits(app, { perAddress: Object.fromEntries(Object.keys(per).map((k) => [k, 100_000])) as typeof per }); |
| 33 | // Nor is it a test of load shedding: on a busy machine the loop runs late, | |
| 34 | // the deep-page budget is divided, and HEAD on a tree page answered 429 | |
| 35 | // where its GET had a 404 (#14601's check). Pinned on time, not on load. | |
| 36 | pinCrawlLag(app, false); | |
| 32 | 37 | servers = await serve(app); |
| 33 | 38 | const admin = await createUser(app.db, { origin: "seed", trusted: true, username: "alice", email: "[email protected]", password: "a-good-passphrase", adminIfFirst: true }); |
| 34 | 39 | if (!admin.ok) throw new Error(String(admin.error)); |
new above
offline