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

The terminal's first boot is paid once per file by the shared test helper, not by whichever test boots first #17572

opened this

Merged 18h 5m ago, live in production

fix/tui-first-boot → main 0 commits

  • Merged. fix/tui-first-boot was merged into main as 2dd8526.

Review

Sign in to review this change.
1 file changed +15 −0
test/helpers/tui.ts +15
@@ -26,9 +26,24 @@
2626 * something real and `timeoutMs` is where to say so.
2727 */
2828
29 import { beforeAll } from "bun:test";
2930 import type { App } from "../../src/tui/app/app.ts";
3031 import { awaiting } from "./awaiting.ts";
3132
33 /**
34 * The terminal's first boot in a process imports its root, its palette and every screen the palette
35 * lists (`tui/forge_parts.ts`, loaded as the app starts, #17496): about 450 ms of CPU on a Mac and
36 * well over a second on a check runner, charged to whichever test booted first. With the test's own
37 * work that took tests over their 2 s CPU budget (#17310) on main's verification, 2026-12-02
38 * ("Enter opens the parked issue…", the terminal mirror test). Every file that waits on the
39 * terminal imports this module, so its hook takes the load once, as the file's cost: a test is
40 * timed without its hooks. Under `--no-isolate` the module is already loaded, and this costs
41 * nothing.
42 */
43 beforeAll(async () => {
44 await import("../../src/tui/forge_parts.ts");
45 });
46
3247 /**
3348 * Consecutive quiet turns before the screen is called settled. Three, not
3449 * one, because a resolved promise can schedule a microtask that schedules a

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs