CI: serialize Swift Testing inside app-host shards - #9717
lawrencecchen wants to merge 15 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe shared ChangesApp-host CI serialization
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 24 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (24 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_ci_change_areas.py`:
- Around line 730-734: Replace the raw substring assertion in the relevant test
with XML parsing scoped to the scheme’s TestAction/EnvironmentVariables node.
Assert that exactly one enabled SWT_EXPERIMENTAL_MAXIMUM_PARALLELIZATION_WIDTH
entry exists there and that its value is 1, ignoring comments and entries from
other actions.
- Around line 723-725: Update
test_app_host_tests_configure_swift_testing_serialization_in_the_xcode_scheme so
it inspects the complete workflow_job_block("app-host-unit-tests") rather than
truncating at "steps:". Parse or match the job-level env mapping with
indentation awareness, ensuring forbidden variables are detected even when env
appears after steps while ignoring step-level environments.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 30ed336e-9dca-4b99-9a99-405889bb1718
📒 Files selected for processing (2)
cmux.xcodeproj/xcshareddata/xcschemes/cmux-unit.xcschemetests/test_ci_change_areas.py
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/test_ci_change_areas.py`:
- Line 12: Update the XML parser import used by the test around ET.parse to
defusedxml.ElementTree, preserving the existing scheme parsing behavior; if that
parser cannot be used, add a narrowly scoped S314 suppression at ET.parse with
the trusted checked-in scheme rationale, without changing global Ruff
configuration.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: b52c0ee1-eeee-4dc8-bccd-6ed8440805da
📒 Files selected for processing (1)
tests/test_ci_change_areas.py
Bugbot is paused — on-demand spend limit reachedBugbot 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. |
|
Closing because the exact speculative merge disproved the approach: disabling Xcode parallel testing collapsed each shard into one long-lived app host and exposed process-order dependence instead of stabilizing the suite. Shard 2 reported 127 failures and shard 1 reported 55 failures in https://github.com/manaflow-ai/cmux/actions/runs/31128817575. The failures span account state, shell configuration, session persistence, hibernation, and WebKit lifecycle, so the focused two-case probe was insufficient. I am keeping process isolation and validating the Sentry stack against the existing sharded runner instead. |
Summary
xcodebuildwrapperWhy
App-host tests share process-global AppKit, account, socket, and store state. Xcode's in-process concurrency let unrelated tests overlap inside one host and produced nondeterministic crashes and hangs. Job-level environment variables and scheme variables were disproven by real CI runs. The supported
xcodebuild -parallel-testing-enabled NOoption controls the test runner directly.This is a principled CI ownership fix. One test host runs one case at a time, while independent machines retain shard-level throughput.
Validation
fb589e7765c4a2cf86b3c1c2b01854e2993a2cb2$autoreview: clean, confidence 0.9Merge state
The exact speculative merge run is in progress. This PR changes CI only, so it does not require a tagged runtime build.
Dictionary
mainbefore required checks run.