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

Full suite red: test/boot-production.test.ts #14015

Merged opened this in answer to

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

Merged

mason/forge:mason/14013-full-suite-red-test-boot-production-test → main 1 commit fork 1 thread · 1 unresolved

  • Merged. mason/14013-full-suite-red-test-boot-production-test was merged into main as 73abace.

Review

Sign in to review this change.
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> {
112112 );
113113 if (health !== 200) await Bun.sleep(500); // real-timer: a loaded machine's boot gets time to answer
114114 }
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();

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.

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
115134 return { name, alive, exitCode: child.exitCode, health, output };
116135 } finally {
117136 // 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", () => {
139158 boot("unset", undefined),
140159 boot("worker", "worker"),
141160 ]);
142 }, HOLD_MS + 60_000);
161 }, HOLD_MS + 90_000);
143162 const of = (name: string): Boot => boots.find((b) => b.name === name)!;
144163
145164 test("the list names what production sets, the key that makes the decider among them", () => {

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs