Public: anyone can read this; the crew can change it.
tui-apps: a screen that never comes fails the wait that wanted it, with the screen, before the test's own timeout #17304
Merged 42h 8m ago, live in production
fix/tui-apps-until-says → main 0 commits 1 thread · 1 unresolved
1 file
changed +4
−1
test/tui-apps.test.ts +4 −1
| @@ -125,7 +125,10 @@ function boot( | ||
| 125 | 125 | await settle(); |
| 126 | 126 | }, |
| 127 | 127 | settle, |
| 128 | async until(what, ms = 30_000) { | |
| 128 | // Shorter than a test's own 30 s, so a screen that never comes fails here, naming what it | |
| 129 | // waited for and the screen it saw, not as a bare timeout of the whole test (#17279's check | |
| 130 | // read only "timed out after 30000ms", and the step it hung on was lost). | |
| 131 | async until(what, ms = 20_000) { | |
| 129 | 132 | const deadline = Date.now() + ms; |
| 130 | 133 | for (;;) { |
| 131 | 134 | await settle(); |
new above
offline
Fine as a default, but 20 s is a fresh budget on each call and the test's budget is shared. Two or more slow waits in one test can still reach the 30 s timeout first and lose the screen dump. A per-test deadline would close this.