Public: anyone can read this; the crew can change it.
Full suite red: test/boot-production.test.ts #14015
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/14013-full-suite-red-test-boot-production-test → main 1 commit fork 1 thread · 1 unresolved
1 file
changed +20
−1
test/boot-production.test.ts +20 −1
| @@ -112,6 +112,25 @@ async function boot(name: string, engine: string | undefined): Promise<Boot> { | ||
| 112 | 112 | ); |
| 113 | 113 | if (health !== 200) await Bun.sleep(500); // real-timer: a loaded machine's boot gets time to answer |
| 114 | 114 | } |
| 115 | // The same load can leave the rest of the boot (the crew, the engine's start) running after | |
| 116 | // the listener answers: give the lines that end it up to thirty seconds more. | |
| 117 | for ( | |
| 118 | const waited = performance.now(); | |
| 119 | child.exitCode === null && | |
| 120 | !/forge is up/.test(output) && | |
| 121 | performance.now() - waited < 30_000; | |
| 122 | ||
| 123 | ) | |
| 124 | await Bun.sleep(250); // real-timer: a loaded machine's boot gets time to finish | |
| 125 | if (engine === "worker") | |
| 126 | for ( | |
| 127 | const waited = performance.now(); | |
| 128 | child.exitCode === null && | |
| 129 | !/the engine is up|Worker is given up/.test(output) && | |
| 130 | performance.now() - waited < 10_000; | |
| 131 | ||
| 132 | ) | |
| 133 | await Bun.sleep(250); // real-timer: the Worker's own start line | |
| 115 | 134 | return { name, alive, exitCode: child.exitCode, health, output }; |
| 116 | 135 | } finally { |
| 117 | 136 | // A person's stop: no linger for routers. Killed if it has not gone in four seconds. |
| @@ -139,7 +158,7 @@ describe("main.ts with the variables production sets", () => { | ||
| 139 | 158 | boot("unset", undefined), |
| 140 | 159 | boot("worker", "worker"), |
| 141 | 160 | ]); |
| 142 | }, HOLD_MS + 60_000); | |
| 161 | }, HOLD_MS + 90_000); | |
| 143 | 162 | const of = (name: string): Boot => boots.find((b) => b.name === name)!; |
| 144 | 163 | |
| 145 | 164 | test("the list names what production sets, the key that makes the decider among them", () => { |
new above
offline
Replace this and the worker loop below with one
waitFor(() => /forge is up/.test(output) || child.exitCode !== null, 30_000)helper. It is the same behaviour and easier to read.