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
Merged 18h 5m ago, live in production
fix/tui-first-boot → main 0 commits
1 file
changed +15
−0
test/helpers/tui.ts +15
| @@ -26,9 +26,24 @@ | ||
| 26 | 26 | * something real and `timeoutMs` is where to say so. |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | import { beforeAll } from "bun:test"; | |
| 29 | 30 | import type { App } from "../../src/tui/app/app.ts"; |
| 30 | 31 | import { awaiting } from "./awaiting.ts"; |
| 31 | 32 | |
| 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 | ||
| 32 | 47 | /** |
| 33 | 48 | * Consecutive quiet turns before the screen is called settled. Three, not |
| 34 | 49 | * one, because a resolved promise can schedule a microtask that schedules a |
new above
offline