Skip to content

test(webviews): B4 waits for conditions, not fixed times (97 waits) - #23585

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
fixed-waits/b4
Oct 21, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
fixed-waits/b4

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fourth browser batch of the fixed-wait sweep. It removes 97 fixed waits in 16 test files, and none are kept with a marker. The batch started with 17 files; base's #23489 already rewrote composer-draft-wrap's waits, so this PR takes base's version of that file.

  • Settling: composer-caret-focus, composer-quiet-chips, composer-menu-dismiss, hover-row-sweep, newtab-quiet-focus, popup-reduce-motion, transcript-follow, transcript-spacing and markdown-wide-table-scroll wait for a painted frame, for the animations that the input started to finish, and for the state the test checks (:hover, aria-expanded, the open chips).
  • Absence checks: a later action that goes over the same socket is the signal. A later Delete shows that a saved-unchanged edit sent nothing, in agent-pane-queue. A later Approve shows that Cancel sent nothing, in permission-deny-feedback. The review broke both on purpose and both went red.
  • In-process dev servers: settings-scroll and settings-search-results start vite in-process on port 0 and close it in afterAll, the way agent-pane-attach-typing does, instead of polling a spawned server.
  • Stand-ins: permission-queue's answer wait resolves when the stand-in daemon receives the response. queue-steer's caughtUp() streams a chunk and waits for it to be drawn.
  • Known base failure: one composer-location-strip test, "at 340 px … a folder name cuts in the middle", fails every run on unchanged base too.
  • Review: the independent review returned SHIP. It ran 7 of the files and found two nits that are not fixed here. Four frame waits have no frame cap of their own, so only the test timeout stops them. settings-scroll adds a wheel listener on every open().
  • Process note: one of the batch's helper agents cleaned up its own test run with pkill -f. It matched only that agent's own shell.

Files:

  • webviews/test/agent-pane-permission-deny-feedback.test.ts
  • webviews/test/agent-pane-permission-queue.test.ts
  • webviews/test/agent-pane-queue-steer.test.ts
  • webviews/test/agent-pane-queue.test.ts
  • webviews/test/agent-pane-transcript-spacing.test.ts
  • webviews/test/composer-caret-focus.test.ts
  • webviews/test/composer-location-strip.test.ts
  • webviews/test/composer-menu-dismiss.test.ts
  • webviews/test/composer-quiet-chips.test.ts
  • webviews/test/hover-row-sweep.test.ts
  • webviews/test/markdown-wide-table-scroll.test.ts
  • webviews/test/newtab-quiet-focus.test.ts
  • webviews/test/popup-reduce-motion.test.ts
  • webviews/test/settings-scroll.test.ts
  • webviews/test/settings-search-results.test.ts
  • webviews/test/transcript-follow.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


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Replaces 97 fixed waits across 16 webviews browser tests with condition-based waits, so tests no longer rely on arbitrary timeouts.

  • Settling waits now use painted frames and wait for the element's animations/transitions to finish, or for the exact state the test asserts (:hover, aria-expanded, open chips).
  • Absence checks use a later action (a Delete, an Approve, a streamed chunk) as the signal that the earlier input was processed, then assert nothing was sent.
  • The settings dev servers (settings-scroll, settings-search-results) now start in-process on port 0 and close in afterAll instead of spawning and polling a server.
  • One composer-location-strip test fails on unchanged base too; four frame waits rely only on the test timeout; settings-scroll adds a wheel listener on every open().

Written for commit 1c1d76d. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 21, 2026 16:07
Removes all 101 fixed waits in the 17 B4 browser tests and drops their
baseline rows.

- Settling after hover, focus, press and Escape waits for painted frames
  (installPaintedFrames) plus the element's own CSS animations and
  transitions finishing, or for the exact state the test then asserts
  (:hover, aria-expanded, open chips, focus).
- Wheel and scroll waits wait until the wheel events arrived and the scroll
  offsets hold steady across painted frames.
- "Nothing was sent" checks use a later action as the signal the page has
  processed the input (a later Delete or Approve, a streamed chunk drawing),
  then assert the absence.
- The settings dev servers start in-process with vite listen() instead of a
  spawned server and a fetch poll.

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
…its/b4

# Conflicts:
#	webviews/scripts/fixed-waits-baseline.tsv
#	webviews/test/composer-draft-wrap.test.ts
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 1c1d76d: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr23585 -f ref=fixed-waits/b4 -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); base red: the same failure on the base b035c0b; does not block

Tour of 1c1d76dd17 (run): no media. The tour did not run: only webview code changed (17 path(s)), which the gallery advisory run checks in Linux Chromium on the pull request (its artifact holds any captures); add the media-tour-mac label to tour it on a Mac.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by window-focus-opacity on huge-blue · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-rq825 created for this PR by the cmux coordinator.

…its/b4

# Conflicts:
#	webviews/scripts/fixed-waits-baseline.tsv
@blacksmith-sh

blacksmith-sh Bot commented Oct 21, 2026

Copy link
Copy Markdown

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp5oigo2ah/summary-missing.json (live):/summary-missing.json (live): View Logs
/tmp/tmpt4krlg4q/summary-fail.json (live):/summary-fail.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
test_a_file_a_test_reads_selects_that_test (main.PullRequestTiers.test_a_file_a_tes
t_reads_selects_that_test)/
test_a_file_a_test_reads_selects_that_test (main.PullRequestTiers.test_a_file_a_tes
t_reads_selects_that_test)
View Logs
test_a_shared_module_selects_its_dependents (main.PullRequestTiers.test_a_shared_mo
dule_selects_its_dependents)/
test_a_shared_module_selects_its_dependents (main.PullRequestTiers.test_a_shared_mo
dule_selects_its_dependents)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (subagent): SHIP at 1c1d76d. That covers the full review, the conflict resolution (draft-wrap takes base #23489) and an interdiff re-review of the latest base merge. The baseline only drops this PR's 16 rows. CI: 91 passed, 1 failed. The red is cmux-next checks / Tier routing: tests/test_cmux_next_route.py fails 2 of 34 on base too, from #22683's CmuxNextChiefViewsTests target, so it isn't this PR's (webview tests only).

@teamleaderleo
teamleaderleo merged commit 09ca3be into feat-cmux-next Oct 21, 2026
@teamleaderleo
teamleaderleo deleted the fixed-waits/b4 branch October 21, 2026 19:35
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant