Public: anyone can read this; the crew can change it.
Flaky test: a real child forge > boots in its own forge:<name> cell and answers / through the forward; its first request is held until it is up #17553
Merged 18h 45m ago, live in production
scout/forge:scout/17552-flaky-test-a-real-child-forge-boots-in-i → main 0 commits fork
1 file
changed +5
−2
test/helpers/real-child-forge.ts +5 −2
| @@ -18,7 +18,7 @@ import { join } from "node:path"; | ||
| 18 | 18 | import { createApp } from "../../src/app.ts"; |
| 19 | 19 | import { cellCounters, cellsAvailable } from "../../src/apps/contain.ts"; |
| 20 | 20 | import { cellChildren, stopCellChildren } from "../../src/spawn/cell.ts"; |
| 21 | import { answerFromCell } from "../../src/spawn/host.ts"; | |
| 21 | import { answerFromCell, wakeLimits } from "../../src/spawn/host.ts"; | |
| 22 | 22 | import { lastHeard } from "../../src/spawn/heartbeat.ts"; |
| 23 | 23 | import "./roomy-disk.ts"; |
| 24 | 24 | |
| @@ -36,6 +36,9 @@ writeFileSync(join(dataDir, "spawn", "kid.json"), JSON.stringify({ ...ledger, do | ||
| 36 | 36 | const childDir = join(dataDir, "children", ledger.bodyId); |
| 37 | 37 | mkdirSync(childDir, { recursive: true }); |
| 38 | 38 | writeFileSync(join(childDir, "parent.json"), JSON.stringify({ name: "kid", upstream: "https://unreachable.invalid", beatKey: "beat-key" })); |
| 39 | // The first request is held until the cell is up; a loaded machine boots slower than the | |
| 40 | // production 20 s hold, so the hold is budgeted to the helper's own timeout (#17552). | |
| 41 | wakeLimits.waitMs = 60_000; | |
| 39 | 42 | const ask = (path: string) => answerFromCell(parent, new Request(`https://kid--f.test${path}`, { headers: { host: "kid--f.test" } })); |
| 40 | 43 | |
| 41 | 44 | try { |
| @@ -48,7 +51,7 @@ try { | ||
| 48 | 51 | const health = child === undefined ? null : (await ask("/healthz")).status; |
| 49 | 52 | // The watch reads the cell's tree once a second, by its label; the child |
| 50 | 53 | // beats once as it boots. Both are asked until seen, not waited out. |
| 51 | const until = Date.now() + 10_000; | |
| 54 | const until = Date.now() + 30_000; | |
| 52 | 55 | let labelled = false; |
| 53 | 56 | let heard = child === undefined ? undefined : await lastHeard(parent, "kid"); |
| 54 | 57 | while (child !== undefined && Date.now() < until) { |
new above
offline