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

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

Merged opened this in answer to

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

Merged

mason/forge:mason/12733-full-suite-red-test-boot-production-test → main 1 commit fork

  • Merged. mason/12733-full-suite-red-test-boot-production-test was merged into main as eb039fd.

Review

Sign in to review this change.
1 file changed +5 −5
test/boot-production.test.ts +5 −5
@@ -10,7 +10,7 @@
1010 *
1111 * Here the tree boots in a child process with every variable production
1212 * sets (`helpers/production-env.ts`: the names, never a value), once for each
13 * way the engine can be asked for, and each boot must be alive ten seconds
13 * way the engine can be asked for, and each boot must be alive eight seconds
1414 * later, still answering, having logged no uncaught exception and no Worker
1515 * it could not start or ask.
1616 *
@@ -28,7 +28,7 @@ import {
2828 } from "./helpers/production-env.ts";
2929
3030 /** How long a boot must stay up after it is started. */
31 const HOLD_MS = 10_000;
31 const HOLD_MS = 8_000;
3232 const MAIN = join(import.meta.dir, "..", "src", "main.ts");
3333
3434 /** What no boot may say: a throw nothing caught, or a Worker that could not be started or asked. */
@@ -106,11 +106,11 @@ async function boot(name: string, engine: string | undefined): Promise<Boot> {
106106 : 0;
107107 return { name, alive, exitCode: child.exitCode, health, output };
108108 } finally {
109 // A person's stop: no linger for routers. Killed if it has not gone in ten seconds.
109 // A person's stop: no linger for routers. Killed if it has not gone in four seconds.
110110 child.kill("SIGINT");
111111 const gone = await Promise.race([
112112 child.exited.then(() => true),
113 Bun.sleep(10_000).then(() => false), // real-timer: how long a real child gets to stop before it is killed
113 Bun.sleep(4_000).then(() => false), // real-timer: how long a real child gets to stop before it is killed
114114 ]);
115115 if (!gone) child.kill("SIGKILL");
116116 await child.exited;
@@ -144,7 +144,7 @@ describe("main.ts with the variables production sets", () => {
144144 });
145145
146146 for (const name of ["inline", "unset", "worker"])
147 test(`FORGE_ENGINE ${name}: alive ten seconds on, still answering, and nothing uncaught in its log`, () => {
147 test(`FORGE_ENGINE ${name}: alive eight seconds on, still answering, and nothing uncaught in its log`, () => {
148148 const b = of(name);
149149 expect(b.alive, `exited with ${b.exitCode}:\n${tail(b)}`).toBe(true);
150150 expect(b.health, tail(b)).toBe(200);

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs