test(webviews): B3 waits for conditions, not fixed times (155 waits)
Third browser batch of the fixed-wait sweep. It removes all 155 fixed waits in 18 test files, and none are kept with a marker. Frame waits use the shared paintedFrames helper (#23374).
- Settling: most files now wait until no animation is running and the scroll position or box holds still over several painted frames. This covers diff-virtualization, older-rows-fade, reading-place, queue-collapse, thread-minimap-motion and
support/papercutChat. diff-virtualization's "no jump" check needs the header at offset 0 for 30 painted frames in a row. queue-collapse's rest needs 10 frames with no scroll event. - Stand-ins that wait for the test: in new-tab-warm-first-frame, the stand-in host and daemon hold their answers until the test releases them. In attach-links, the daemon resolves a promise when the prompt arrives.
- Absence checks: start-mode-chip records its own start-mode requests. Its "returning asks nothing" check waits for every answer after a pushed change and counts exactly one ask, so a re-ask sent 100 ms after focus fails it. ime-composition-keys checks after two painted frames.
- Polls: loops in agents-pill, unsent-draft and markdown-wide-width-layout became
waitForFunctionorlocator.waitForon the state the test then checks. - Merge with base: base changed
papercutChat(#23243 added anoptions.readyselector) andthread-minimap-motion(#23529 samples after the frame paints). Both sides are kept. Both files and wheel-pass-through, which uses papercutChat, pass on the merged head. - Known flake: thread-minimap-motion's click-scroll timing check fails some runs on unchanged base as well (608 to 635 ms against a 500 ms limit under load).
- Review: the independent review returned FIX for the start-mode-chip absence check, which caught only an immediate re-ask; that is fixed in this PR. It also noted two waits that end only at the bun timeout and two that swallow their timeout as before; these are minor and not changed.
Files:
webviews/test/agent-pane-agents-pill.test.tswebviews/test/agent-pane-attach-links.test.tswebviews/test/agent-pane-older-rows-fade.test.tswebviews/test/agent-pane-queue-collapse.test.tswebviews/test/agent-pane-reading-place.test.tswebviews/test/agent-pane-soft-edges.test.tswebviews/test/agent-pane-start-mode-chip.test.tswebviews/test/agent-pane-unsent-draft.test.tswebviews/test/desktop-feel.test.tswebviews/test/diff-virtualization.test.tswebviews/test/ime-composition-keys.test.tswebviews/test/markdown-wide-width-layout.test.tswebviews/test/menu-pointer-close-focus.test.tswebviews/test/new-tab-warm-first-frame.test.tswebviews/test/quick-composer-chief-dock.test.tswebviews/test/quiet-access-chip.test.tswebviews/test/support/papercutChat.tswebviews/test/thread-minimap-motion.test.ts
Checks: the baseline only goes down. Measured against base with the lane's row check, no row is raised or added, and every changed row belongs to a file this PR changes. check:fixed-waits, check:browser-lanes, bun run check and scripts/web-lint.sh pass on the merged head. Each changed file ran 3 times with CMUX_BROWSER_TESTS=1, one browser file at a time.
Agent session: huge-blue
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Third batch of the fixed-wait sweep: replaces all 155 fixed waits in 18 webview test files with condition-based waits, mostly using the shared paintedFrames helper.
- Most files wait until no animation runs and the scroll position or box holds still over several painted frames; the diff viewer also waits for CodeView to re-enable pointer events after a scroll.
- Stand-in hosts and daemons hold their answers until the test releases them (
new-tab-warm-first-frame) or resolve a promise when a request arrives (attach-links,start-mode-chip), instead of answering after delays. - Absence checks wait for a positive signal first:
start-mode-chipcounts its own_acpmux/start_modeasks and waits for every answer after a pushed change, so a re-ask sent 100 ms after focus fails it. - Polls with sleeps became
waitForFunctionorlocator.waitForon the state the test then asserts. - The review's FIX for the
start-mode-chipabsence check is in; the two waits that end only at the bun timeout and the two that swallow their timeout are unchanged. thread-minimap-motion's click-scroll timing check still flakes on unchanged base (608–635 ms against a 500 ms limit under load).- The baseline row for each changed file moves to zero; no row is raised or added.