Repository navigation
test(webviews): B2 waits for conditions, not fixed times (110 waits) - #23454
Conversation
#23374 merged after the fixed-wait ratchet (#23365) ran CI, and it added a 3 s waitForTimeout in two tests, which puts feat-cmux-next over its baseline. Both waits are observation windows: the test records every painted frame for 3 s after the chat opens and asserts none jumped, so the time is the test. They carry a fixed-wait marker instead of a raised baseline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15c78-27ca-7140-a6c7-95f0db83b18c&host=huge-blue
Removes the fixed sleeps from the B2 batch's 18 browser-test files. - Daemon round trips: the stand-in acpmux daemons wake a bounded `until` on each message they take, so a test waits for the cancel, prompt, view or offer reply itself, and fails naming what never came. - Absence checks (no cancel, no prompt, no /btw, no armed stop, no second view, no card) wait for a later positive signal first: the page answers a lag notice sent after the input with its refetch, or draws a record sent after it (a failover note or a reply chunk), so anything it would have sent or drawn has arrived before the assertion. Counts of exactly one also wait for that signal. - Stop's 5 s grace and the composer's activation settle run on Playwright's page.clock: the steer and focus-content tests move past them instead of sleeping through them. - The turn footer waits for the footers' opacity to reach its end value; the diff find and working counts read until the state holds (bounded). - Layout settles convert to the shared painted-frame helper (support/paintedFrames.ts): two painted frames after a mount or a font load, the page's finite animations finished first after a fold, a hover, a focus or a resize, and 20 painted frames for the latency probe's frame budget. thin-scrollers waits for data-cmux-scrolling. - reopened-chat-history waits on the daemon's answers (nothing in flight, an older read answered) instead of a 250 ms quiet window. - Two waits keep a reasoned marker: the stream jitter test's chunk cadence is the input under test, and dev-server-stop polls the process table because nothing reports a grandchild's exit. - The stream jitter test's remaining settle and observation windows are left for the frame work (scroll glides are JS-driven, so animation state cannot say they ended). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15c78-27ca-7140-a6c7-95f0db83b18c&host=huge-blue
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
…its/b2 # Conflicts: # webviews/test/agent-pane-recap-card.test.ts
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Passes: CI passes on CI passes on Written by web and size checks: green
Tour of |
|
Bead |
|
|
|
Review (subagent): SHIP at 1b28b43 (the later base merge only resolved recap-card's imports; recap-card 7/7). Reds are base: check:fixed-waits names five files outside this PR (fixed in #23452), defaults-snapshot (FileExplorerSectionView.swift); Web status, the shard rollup and fast-gates follow from those. |
…its/b2 # Conflicts: # webviews/scripts/fixed-waits-baseline.tsv
|
Owned by window-focus-opacity on huge-blue · session |
…its/b2 # Conflicts: # webviews/scripts/fixed-waits-baseline.tsv
|
Review (subagent): SHIP at 551daa0 (interdiff re-review of the base merge: same test change, and the baseline only lowers this PR's own rows). Remaining reds aren't this PR's: backend-migrations plan (this PR changes webviews test files only), plus cancelled jobs (autofix export areas, cmux-tui preflight, mux bun test). |
|
Shipped in:
|
Batch B2 of the fixed-wait sweep: 18 webview test files wait for the condition they assert instead of a fixed time. 110 waits removed (124 → 14 in these files on the ratchet baseline).
What the waits became:
page.clock.installPaintedFrames,cmuxPaintFrame): animations finished, then two painted frames (edited-copy, recap-card, step-rows, model-picker, reasoning-chip, thin-scrollers, latency-harness).Left: 14 counted waits, all frame waits in
agent-pane-stream-jitter.test.ts, where scroll glides run in JS and finished animations don't mean the view is at rest. Two new// fixed-wait:markers: the chunk cadence in stream-jitter is the input under test, anddev-server-stoppolls the process table, since nothing reports when a grandchild process exits.Verification: every changed file ran 3 times with
CMUX_BROWSER_TESTS=1, one file at a time; all passed. The one failure was a single steer run during a concurrentbun run check, in a test this PR doesn't change (a 1.6 s window). Breaking the behavior on purpose (steer's Stop grace, focus-content's press window, recap's toggle and Not now, seen's view after attach) made the affected tests fail.check:fixed-waits(882),bun run check,scripts/web-lint.shand the prepush gate pass. The independent review ran all 17 changed browser files once more: all pass.check:fixed-waitsmay be red here until #23452 lands: #23094 added 9 fixed waits to base after the guard merged.Agent session: huge-blue
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Replaces fixed-time sleeps in 18 webview browser-test files with waits on the conditions they assert, removing 110 fixed waits (124 → 14 on the ratchet baseline).
What the waits became
page.clockinstead of sleeping through them.installPaintedFrameshelper.agent-pane-stream-jitter.test.ts(scroll glides run in JS) plus four marked fixed waits: the chunk cadence under test,dev-server-stop's process-table poll, and two 3 s frame-watch observation windows added by the webviews tests: frame tests read layout after the frame paints #23374 merge.Written for commit 551daa0. Summary will update on new commits.