Enroll CLIIntegrationTests in CoreSimulatorHygiene before its iOS boots - #324
Merged
Conversation
The bar's full-graph run timed out this suite at 300s while the same suite passes isolated in the same VM in 184s (and MCPIntegrationTests, which got the resetOnce enrollment in #319, passed right after the timeout). CLIIntegrationTests runs after PreviewsIOSTests and IOSPreviewE2ETests have degraded the host-global CoreSimulator service, and it is the one sim-booting suite #319's enrollment missed: its VM run tracked the healthy local timeline 1:1 for 112s, then the tail suites consumed the remaining 187s without completing. Per-target copy of CoreSimulatorHygiene (like DaemonTestLock — test sources aren't shared across swift_test targets and the once-per- process guard is per-target by design); IOSCLIWorkflowTests calls resetOnce() under DaemonTestLock before the first iOS preview boots, mirroring IOSMCPTests/IOSHIDInputTests/IOSAppServerTests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPF6gjyr2BBuz31yRSnMvG
- snapshotIOS (SnapshotCommandTests) also boots an iOS session and suite lock order is nondeterministic, so it gets the same resetOnce() call — the faithful #319 mirror enrolls every iOS-booting suite (the MCP target has three call sites for the same reason). - The copied private run() helper is replaced with CLIRunner.runExternal: bounded (300s) and cancellation-safe where waitUntilExit was unbounded in exactly the wedged-simctl scenario this code targets. - cleanSlate() now precedes the service bounce, and the copied comment no longer references MCPIntegrationTests' pickUDID. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPF6gjyr2BBuz31yRSnMvG
…t lock docs - The done-flag now flips only after both reset commands complete, so a reset interrupted by a time-limit cancellation is retried by the next enrolled test instead of silently no-opping for the rest of the process; DaemonTestLock (held by every caller) serializes the check-then-run. Applied to both per-target copies. - The CLI copy bounds the commands at 60s/15s instead of runExternal's 300s default, so a wedged simctl cannot eat the ten-minute suite budget the reset exists to protect. - Both headers now state the real serialization guarantees: the flock is per-target, cross-target safety comes from the exclusive tag within one bazel invocation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPF6gjyr2BBuz31yRSnMvG
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The merge bar's full-graph VM run timed out
CLIIntegrationTestsat the 300s default ceiling while the same suite passes isolated in the same VM in 184s. The VM's per-suite progression tracked a healthy local run 1:1 for 112s, then the tail suites (Snapshot/Stop/Variants) consumed the remaining 187s without completing — the suite runs afterPreviewsIOSTestsandIOSPreviewE2ETestshave degraded the host-global CoreSimulator service. This is the exact mechanism #319 root-caused and fixed forMCPIntegrationTests(which passed at 261s in the same failing bar run);CLIIntegrationTestsis the target #319's enrollment missed.What
CoreSimulatorHygiene(likeDaemonTestLock— test sources aren't shared across swift_test targets and the once-per-process guard is per-target by design), with its commands routed throughCLIRunner.runExternalbounded at 60s/15s so a wedgedsimctlcannot eat the suite budget the reset protects.iosCLIWorkflow,snapshotIOS) — suite lock order is nondeterministic, mirroring Salvage the iOS e2e deflake product fixes to main #319's all-suites pattern.exclusivetag across targets within one invocation).Verification
bazel test //previewsmcp/Tests/... --nocache_test_results: 9/9 green🤖 Generated with Claude Code
https://claude.ai/code/session_01PPF6gjyr2BBuz31yRSnMvG