Skip to content

test: settle the window before measuring the unread sidebar-row invalidation - #14568

Merged
lawrencecchen merged 3 commits into
mainfrom
fix/main-red-apphost
Sep 27, 2026
Merged

lawrencecchen merged 3 commits into
mainfrom
fix/main-red-apphost

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

The unread-sidebar-row invalidation test can count a delayed file-explorer setup update as an unread-change regression. It now waits for three consecutive quiet runloop drains before starting the measurement, using the same bounded settling loop as the minimal-mode test. Assertions and product behavior are unchanged. Part of #13879.

The same failure appeared in main runs 36106360658 and 36114055694, and again in the app-host run for #14806: _fileExplorerStore changed during the measurement and both body counts were 1.

Validation

The affected test explicitly passed on the original head 44d8919715b09 in this app-host job; that job had unrelated failures. The refreshed head 5670e73f0d08c9f8a2c98a5a0d5d01f287ca8e1e preserves the original one-file patch and passes all 66 local guard steps plus Swift syntax validation. Current-head native compile admission and all 16 tests in the affected suite passed, including testUnreadChangeUpdatesOnlyAffectedSidebarRow. The original broad plan covered unrelated historical failures. Validation is now scoped to native compile admission and the changed app-host suite. The obsolete full-suite run was cancelled while its shards were queued. The router selected another compile admission for the focused run; no compile-reuse result is claimed.

Changelog

none


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


Summary by cubic

Fixes the flaky testUnreadChangeUpdatesOnlyAffectedSidebarRow by settling the window to a quiet state before measuring sidebar-row invalidation.

The selected workspace's directory reaches the file explorer a few runloop turns after the first render, so ContentView can re-evaluate inside the measurement window on slower runs. This extracts the quiet-drain loop from #14298 into a shared waitForQuietChromeBodies helper and runs it before the unread test starts counting. No assertions or product code change.

Written for commit 5670e73. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Tests
    • Improved the reliability of checks for minimal mode and unread sidebar behavior by waiting for interface updates to settle before measurements.
    • These changes affect test validation only; no user-facing behavior changes are included in this update.

…idation

testUnreadChangeUpdatesOnlyAffectedSidebarRow failed on main runs
36106360658 and 36114055694 with contentViewBody and workspaceContentBody
at 1. Both logs show "ContentView: _fileExplorerStore changed." inside the
measured window: the selected workspace's directory reaches the file
explorer a few runloop turns after the first render, the same setup
publish #14298 fixed for the minimal-mode toggle test.

Move #14298's quiet-drain loop into a shared helper and run it before the
unread test looks up its rows and starts counting. The assertions are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@teamleaderleo teamleaderleo added the full-ci EXPENSIVE: full macOS tests/builds; overrides selective PR routing. Not needed for normal checks. label Sep 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 84511023-6be6-4949-8393-53a364cac0bb

📥 Commits

Reviewing files that changed from the base of the PR and between 515b3b1 and 0ce07d3.

📒 Files selected for processing (1)
  • cmuxTests/WorkspaceContentViewVisibilityTests.swift

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The visibility tests now use a shared helper to wait for chrome-body reevaluations to settle before measuring invalidations. The helper allows up to 100 run-loop drains and requires three consecutive quiet drains.

Changes

Visibility test settling

Layer / File(s) Summary
Wait for quiet reevaluations
cmuxTests/WorkspaceContentViewVisibilityTests.swift
The helper resets probe counts and drains the main run loop until it observes three consecutive quiet drains or reaches 100 drains. The minimal-mode and unread-sidebar tests require this settling step before measuring invalidations.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: austinywang

Merge Risk: ⚪ Minimal · up to 0ce07

The visibility tests can proceed with the shared settling helper; no identified issue blocks merging after normal checks.

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS: The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The diff adds a test helper and settles run-loop state before measurements. It does not change Cloud terminal creation,…
Cmux Swift Actor Isolation ✅ Passed The authoritative PR diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. All changes are test setup, a private test helper, and comments. No production Swift code, actor declarati…
Cmux Swift Blocking Runtime ✅ Passed PASS: The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The new waitForQuietChromeBodies loop is test-only deterministic scaffolding, and the existing run-loop drain was reu…
Cmux Browser Automation Off-Main ✅ Passed PASS: The pull request changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It adds a run-loop settling helper and calls it from two visibility tests. It does not change browser.* soc…
Cmux Expensive Synchronous Load ✅ Passed The pull request changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The diff adds a test-only run-loop settling helper and calls it from two tests. It adds no production Swift code, a…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It adds and uses a test-only run-loop settling helper. It does not change production Swift, TypeScript, or Ja…
Cmux No Hacky Sleeps ✅ Passed PASS: The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift, a Swift test file. The custom check applies to production TypeScript, JavaScript, shell, and non-Swift build/runtime ch…
Cmux Algorithmic Complexity ✅ Passed PASS: The pull request changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The added bounded quiet-drain loop is test-only scaffolding, and the complexity rule explicitly passes test-o…
Cmux Swift Concurrency ✅ Passed PASS. The diff changes only XCTest/AppKit test synchronization. It extracts an async quiet-drain helper and adds two await call sites. The added code does not introduce Dispatch queues, Combine state,…
Cmux Swift @Concurrent ✅ Passed PASS. The diff adds waitForQuietChromeBodies as an @MainActor async helper. It only resets counters and coordinates drainMainRunLoop, which performs UI run-loop work. Both callers are already `@…
Cmux Swift Package Boundaries ✅ Passed PASS: The diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It adds a private test helper and updates two UI tests. The boundary rule explicitly allows test code and small UI/Ap…
Cmux Swiftpm Lockfiles ✅ Passed PASS. The reviewed diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It does not change a Package.swift, Package.resolved, .gitignore, workflow, or Xcode package reference…
Cmux Swift Logging ✅ Passed PASS. The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift, which is test code allowed by the rule. The diff adds no print, debugPrint, dump, NSLog, Logger, or file/stdo…
Cmux User-Facing Error Privacy ✅ Passed PASS. The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The added helper, #require messages, and explanatory comments are test-only and have no concrete path to a cmux end u…
Cmux Full Internationalization ✅ Passed PASS. The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift, a test target. The added strings are test assertions and developer-only comments, which the rule explicitly allows. No …
Cmux Swiftui State Layout ✅ Passed PASS. The diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It extracts an existing run-loop drain loop into waitForQuietChromeBodies and calls it before test measurements. It…
Cmux Architecture Rethink ✅ Passed PASS. The diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It extracts a bounded quiet-run-loop helper and uses it in two tests before measurement. This is test-only synchroniz…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS. The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It refactors a quiet-run-loop helper and adds its use to an existing test fixture NSWindow. The rule explicitly allow…
Cmux Source Artifacts ✅ Passed The PR changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. The diff adds and refactors hand-written test code, including a shared settling helper and test comments. It does not add log…
Cmux No Test Or Debug Seam In Production Source ✅ Passed PASS: The authoritative diff changes only cmuxTests/WorkspaceContentViewVisibilityTests.swift. It adds a private test helper and updates test setup; it does not modify any Swift file under a product…
Title check ✅ Passed The title clearly identifies the main change: settling the window before measuring unread sidebar-row invalidation.
Description check ✅ Passed The description explains the flaky test, the quiet-drain fix, unchanged product behavior, and validation results. It includes changelog information, but it omits the template's formal Summary heading …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawrencecchen
lawrencecchen enabled auto-merge (squash) September 25, 2026 17:38
@cursor

cursor Bot commented Sep 25, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

Catch-up merge by scripts/ci/catch_up_pr.py (RFC #14631).
Merged by scripts/merge-main.sh: origin/main at 0758c9f, the newest commit with green CI fast guards (1 newer skipped).

Catch-up-previous-head: 44d8919
Catch-up-base: 0758c9f
@teamleaderleo teamleaderleo removed the full-ci EXPENSIVE: full macOS tests/builds; overrides selective PR routing. Not needed for normal checks. label Sep 27, 2026
@lawrencecchen
lawrencecchen merged commit 4cabdf4 into main Sep 27, 2026
79 of 90 checks passed
@lawrencecchen
lawrencecchen deleted the fix/main-red-apphost branch September 27, 2026 14:55
@github-actions

Copy link
Copy Markdown
Contributor

Merge receipt for 5670e73f0d, merged 2026-09-27 14:55:57 UTC

  • Not verified at merge: app-host unit tests (8) (cancelled)
  • Verified: ci-status, macOS compile admission, Web complexity, web-validation, CI fast guards, CI timing, Fast static checks, GhosttyKit release check, guards (6), late-placement, linux-preflight, macOS admission gate, and 3 more
  • Skipped by policy: admission-placement, browser, Claude wrapper regressions, CLI product tests, release-admission, release-build, remote-daemon, suite-coverage, swift-package-tests, tests-build-and-lag, web, web-build, and 2 more
  • Full suite: runs on main after merge.

Labeled merged-unverified: if main breaks near this merge, look here first.

@github-actions github-actions Bot added the merged-unverified A judging check was not green at merge; see the merge receipt comment label Sep 27, 2026
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 27, 2026
648d5c1 Add a Paste Last Screenshot action with an unbound shortcut (manaflow-ai#14955)
ff61677 ci: avoid partial blobs in catch-up merges (manaflow-ai#15023)
4d0d112 ci: retry transient catch-up GraphQL failures (manaflow-ai#15021)
212e808 ci: attribution scores a lone suspect and reports app-host crashes apart (manaflow-ai#14952)
4cabdf4 test: settle the window before measuring the unread sidebar-row invalidation (manaflow-ai#14568)
12ec99b Add a release-media capture tool for changelog screenshots and clips (manaflow-ai#15010)
ee2cda0 Backfill Unreleased changelog and draft next release cards (manaflow-ai#14999)
be4adf8 Show a brief notice when Cmd+V fails on an oversized image or a timeout (manaflow-ai#14953)
23d22d7 ci: an owned pool the run starts on now beats an earlier one it queues on (manaflow-ai#14993)
05d0190 ci: catch-up posts once per head, says less, and merges inserted declarations (manaflow-ai#15018)
4ee4b21 ci: fail stalled Swift package tests instead of waiting out the job timeout (manaflow-ai#14997)
9ce512a merge-main: run local guards only when asked (manaflow-ai#15016)
d60108a ci: clear test-e2e's fixed DerivedData with clear-dirs.sh (manaflow-ai#14994)
1d7895e ci: run the shell and CLI no-socket lanes in parallel (manaflow-ai#14990)
6e7d25f Honor macOS Differentiate Without Color, Increase Contrast and Reduce Transparency (manaflow-ai#14991)
966b355 Stop interrupting focused work: sidebar jumps, Computer Use focus steal, quit dialog on logout (manaflow-ai#14961)
e1f1cb2 Strip control characters from feedback attachment filenames (manaflow-ai#14783)
0758c9f test: find the onboarding window the test presented, not a leftover (manaflow-ai#15015)
b35c540 fix(spm): resolve GhosttyKit/GhosttyRuntimeTestStubs target name collisions (manaflow-ai#10569)
ef33bed Map .purs artifacts to the Haskell highlight.js grammar (manaflow-ai#14202)
e2a167a Highlight Elixir and Erlang files in the file editor (manaflow-ai#13732)
972c449 fix: wrap Linux browser download card label (manaflow-ai#11157)
f563884 Add Aside to browser data import detection (manaflow-ai#13379)
091d0ea Add cmux send --paste and hint at it for large multi-line sends (manaflow-ai#14937)
3ffcdbb test(ios): keep folder-tap stat tests off the real 2 s deadline (manaflow-ai#15017)
68d3936 test: keep CmuxTerminal pasteboard tests off the cooperative pool (manaflow-ai#15006)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-unverified A judging check was not green at merge; see the merge receipt comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants