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

Every wait names itself: a test that ends while a wait waits says what it waited for and what it saw #17308

opened this

Merged 35h ago, live in production

A wait helper whose deadline is at or past its test's timeout never raises its own error: bun's timeout ends the test first, and the log reads only "timed out after 30000ms" (#17279's tui-apps hang, its step lost).

Notes

opened this

A wait helper whose deadline is at or past its test's timeout never raises its own error: bun's timeout ends the test first, and the log reads only "timed out after 30000ms" (#17279's tui-apps hang, its step lost). Now a wait notes what it waits for (test/helpers/awaiting.ts: awaiting, noted), and the suite's afterEach (preload) prints what a test ended still waiting for, how long, and the state it saw, whichever deadline won.

Noted: waitFor (its condition's source when given no words) and pollUntil, settleUntil (the screen), checks-forge's settled and until (the checks' states), agentRunSettled (the agent runs), deploySettled (the deploys), askForPreview (the preview's status), engine_split's until, and the screen harnesses' until in tui-apps, tui-workflows and surfaces-adversarial (the screen). No deadline is changed.

The rule (test/waits-name-themselves.test.ts, a tree scan, so it runs on every check): a function named for waiting that polls must note itself, directly or through those helpers. The 94 that did not when the rule came are listed, and the list only shrinks. A second test proves the mechanism: a scratch test that times out at 200 ms while two waits wait prints both, with the state one saw.

No door: test only. Direction: a red says why, to the builder who reads it (#12295).

🤖 Generated with Claude Code

Sign in to join this conversation.

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

Keyboard shortcuts

Docs