Skip to content

test(testing): raise waitForText poll default 5000→10000ms to de-flake render tests - #120

Merged
myobie merged 1 commit into
mainfrom
fix/screenshot-waitfortext-timeout
Jul 22, 2026
Merged

test(testing): raise waitForText poll default 5000→10000ms to de-flake render tests#120
myobie merged 1 commit into
mainfrom
fix/screenshot-waitfortext-timeout

Conversation

@myobie

@myobie myobie commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Raise waitForText poll default 5000→10000ms to de-flake render tests

The required vitest gate flaked on screenshot.test.ts > preserves 256-color codes — timed out at 5000ms waiting for text. (This is the still-open flake
after #119; my fix raced #119's merge and didn't make it in, so re-submitting.)

Why #116 didn't fix it: #116 raised vitest's testTimeout to 15000ms, but
the real 5000ms is waitForText's own internal poll timeout
(src/testing/session.ts), which #116 never touched. So #116 fixed the
true-color flake's symptom (the blunt vitest test-timeout) but left the
underlying too-tight render-poll budget — which resurfaced as the 256-color
waitForText timeout.

Fix: raise the waitForText / waitForAbsent / waitFor default
5000→10000ms, matching the explicit 10000–15000ms that render-heavy tests
already pass (scrollback-fidelity.test.ts) and staying under
screenshot.test.ts's 15000ms vitest testTimeout, so a slow wait fails with
the useful "waiting for X" message rather than a blunt vitest timeout. Only
affects failure/slow-wait latency; a matching wait returns immediately.

Verification: render suites green locally (49 tests), full suite green,
typecheck clean. The CI-load timing can't be reproduced locally, but 10000ms is
2× the budget that tripped. Test-support-library default only; no product
behavior change. (Verified green in the #119 fresh CI run before that PR merged
parity-only.)

…ke render tests

The vitest gate flaked a 2nd time — screenshot.test.ts "preserves 256-color
codes" timed out after 5000ms waiting for ORANGE. #116 raised VITEST's
testTimeout (15000ms), but the real 5000ms is waitForText's OWN internal poll
timeout (src/testing/session.ts), which #116 never touched — so terminal render
under CI load still tripped it. Raise the waitForText/waitForAbsent/waitFor
default to 10000ms, matching the explicit 10000-15000ms render-heavy tests
already pass (scrollback-fidelity.test.ts) and staying under screenshot's
15000ms vitest testTimeout. Only affects failure/slow-wait latency; a matching
wait returns immediately.

Folded into this PR so it fixes BOTH required-gate flakes (parity teardown
ENOTEMPTY + screenshot render timeout) and one CI run validates both.
@myobie
myobie merged commit 5017732 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant