fix(ios-e2e): wait for session root before terminate to avoid launchd race#319
Conversation
… race (#318) The smoke-lane test `testLaunchLoginCompleteSessionAndHistoryPersistence` called `terminate()` immediately after `beginButton.tap()`, racing the simulator's launchd while the app was mid-navigation / audio init. That produced `Failed to terminate ... :0` failures and post-relaunch home-wait timeouts on macos-26 / iOS 26 runners while `ios-e2e-critical` stayed green on the same SHAs. Use the existing `tap(_:thenWaitForRoot:in:)` helper so terminate fires from a quiescent in-session state. Closes #318 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
CodeAnt AI is reviewing your PR. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@cursor review |
📝 WalkthroughWalkthroughThe UI test now waits for the session root to appear after tapping the Begin button (using the existing tap helper) before changing the launch environment and calling terminate/relaunch, preventing termination during in-flight session initialization. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d9e69aa. Configure here.
|
CodeAnt AI finished reviewing your PR. |
…inate The first attempt swapped `beginButton.tap()` for the `tap(_:thenWaitForRoot:in:)` helper. That helper uses `tapByStableCenter`, which gates on an 8s stable-frame check and silently skips the tap when the frame is unstable. On the smoke lane the helper retried 3x with 12s session-root waits and never registered a session transition, failing the test. Keep the direct `beginButton.tap()` (proven in earlier passing runs) and add an explicit `waitForExistence(timeout: 20)` on `root.currentView.session` before `terminateAppReliably`. Same idle-before-terminate benefit; no change to tap semantics. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@cursor review |
|
@coderabbitai full review |
|
@CodeAnt-AI review |
✅ Actions performedFull review triggered. |
|
CodeAnt AI is running the review. |
|
@graphite-app re-review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 607af03. Configure here.
Sequence DiagramThis PR updates the smoke test flow so that after tapping Begin on the home screen, the test explicitly waits for the in-session screen to appear before terminating and relaunching the app, reducing a race with the simulator process. sequenceDiagram
participant Test
participant App
Test->>App: Launch app and perform login
App-->>Test: Display home screen
Test->>App: Tap Begin on home
App-->>Test: Display session screen
Test->>App: Wait for session root then terminate app
Test->>App: Relaunch app and verify home and session persistence
Generated by CodeAnt AI |
|
CodeAnt AI finished running the review. |
…fter-navigation race (#321) * docs(ios-ui-tests): add Patterns and pitfalls section for terminate-after-navigation race Documents the launchd race that PR #319 fixed: terminating right after a navigating tap can hang the simulator with "Failed to terminate ... :0". Records the canonical "direct .tap() + explicit waitForExistence on root.currentView.<slug>" pattern, and explains when the existing tap(_:thenWaitForRoot:in:) helper is appropriate vs when its tapByStableCenter gating silently skips the tap. Closes #320 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * docs(ios-ui-tests): address CodeRabbit nits on Patterns and pitfalls - Add `text` language tag to the unlabeled fenced block showing the Failed-to-terminate output (markdownlint-friendly). - Cite the passing CI run alongside the failing one to document both ends of the d9e69aa → ddf7b69 transition. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>

Summary
ios-e2e-smokelane:testLaunchLoginCompleteSessionAndHistoryPersistencewas failing withFailed to terminate ... :0(or post-relaunch home-wait timeout) on macOS-26 / iOS 26 runners, whileios-e2e-criticalstayed green on the same SHAs across 4 recent runs (25215904325,25216409703,25216402153,25216777439).terminate()was called immediately afterbeginButton.tap(), racing launchd while the app was mid-navigation / audio engine startup / timer init.beginButton.tap()and add an explicitwaitForExistence(timeout: 20)forroot.currentView.sessionbeforeterminateAppReliably. v1 usedtap(_:thenWaitForRoot:in:), but itstapByStableCenterstable-frame check failed on this test's specific flow (run 25218186115).Closes #318
Test plan
testLaunchLoginCompleteSessionAndHistoryPersistencepasses on iOS 26 simulator (verified via smoke lane green on607af03)ios-e2e-smokelane passes on this PR (run 25218888601)ios-e2e-criticallane passes on this PR607af03; one more re-run pending)StillPointAppUITestsunaffected (diff modifies only the one method; 9 other tests untouched)ios/StillPointApp/changed (test-only single-file diff: +5/-0)🤖 Generated with Claude Code