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

The suite's preload registers its afterEach only under bun test, so a child it preloads outside a test run loads #17354

opened this

Merged 32h 26m ago, live in production

fix/preload-outside-runner → main 0 commits 1 thread · 1 unresolved

  • Merged. fix/preload-outside-runner was merged into main as 9ba7513.

Review

Sign in to review this change.
1 file changed +10 −4
test/helpers/preload.ts +10 −4
@@ -66,7 +66,13 @@ const { useWatchProbeByDefault } = await import("../../src/spawn/watch_probe_def
6666 useWatchProbeByDefault(() => async () => true);
6767
6868 // A test that ended (a timeout above all) while a wait helper still waited says what it waited for
69 // and the state it saw (`awaiting.ts`, #17279): a hang names its step on its first failure.
70 afterEach(() => {
71 for (const line of stillWaiting()) console.error(line);
72 });
69 // and the state it saw (`awaiting.ts`, #17279): a hang names its step on its first failure. Only
70 // under `bun test`: the preload also loads a child that is not a test run (load-order's
71 // `bun --preload … -e`), where `afterEach` throws and every such child exited 1.
72 try {
73 afterEach(() => {
74 for (const line of stillWaiting()) console.error(line);
75 });

The bare catch hides any error from afterEach, not just the not-in-a-test-run one. Match the message and rethrow the rest.

76 } catch {
77 // Not a test run: nothing waits to be said.
78 }

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

Keyboard shortcuts

Docs