Repository navigation
Conversation
…econd testNavigationGlassMergesAndRestoresInBothDirections timed out on CI (run 44682658228) waiting 2 s for the side surfaces of MergingNavigationGlass to fade out after setMenuOpen(true), a 0.18 s animation. The test waited with XCTNSPredicateExpectation, which evaluates its predicate about once a second: the test's four waits take about 4 s in passing runs, 1 s each for a 0.18 s animation. A 2 s timeout therefore gets one or two evaluations. RunnerTests runs inside the Flutter app, and when that app holds the main thread across those evaluations the wait expires even though the animation has long finished. In the failing run the 2 s timeout was reported 5.2 s after the test started. Replace both waits with a `waitUntil` helper that checks the condition every 10 ms on the main actor for up to 10 s, the budget the other RunnerTests callbacks use. It checks the condition before the deadline on every pass, so a main-thread stall of any length is followed by one more check rather than a timeout. The conditions and the assertions after them are unchanged, and the test no longer spends 4 s waiting. The cause is inferred from the CI timings and the code. Not compiled or run locally; `swiftc -parse` accepts the file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matt Toohey <contact@matttoohey.com>
The merged and restored values are set as soon as an animation starts, so both waits passed on their first check. Also require that the side layers have no running animations, so the close that follows starts from a finished animator. Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> Signed-off-by: Tom Brow <tomb@block.xyz>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord recommends approval at 0519036. Two source reviews found no issues with the animation waits, and the native iOS CI job was still running at review time.
jedwards27
left a comment
There was a problem hiding this comment.
🤖 :bot: Jude’s code review agent — changes recommended on 05190369eef50ac538c53ed58ee3213244f25db2 (base aee2ab3f7a9ba6e1b0066291297bdd4afc071893). This is a test-only correctness finding, not a production UI finding.
The wait does not establish animation completion. mobile/ios/RunnerTests/RunnerTests.swift:71–86,94–99 creates MergingNavigationGlass without a window and interprets empty leftSurface/rightSurface.layer.animationKeys() as “finished.” Those keys can also be empty when no Core Animation was installed/observed on the detached layers, or when Reduce Motion skips animation. The property animator in mobile/ios/Runner/JumpToLatestGlassButton.swift:827–865 is configured for 0.18 s; the PR reports only 0.07 s for both orientations. Timing alone is not conclusive, but the test never observes the animation start or its completion, so the central promised case—closing after a completed open—is not proven. The existing state mutations demonstrate assertions are sensitive to state, not to that completion boundary.
Author action: Exercise the animated path in a visible test window (skip explicitly if Reduce Motion is enabled), and require an observed active animation followed by a completed animation before the first close; an explicit property-animator completion signal is also a sound alternative. Preserve the back-to-back close/open/close burst. Demonstrate that a mutation making post-completion close a no-op fails because the completion boundary is exercised, with an exact-head native simulator run. A mere delay without a start/completion assertion would leave the same blind spot.
Validation / ownership: Source and exact-head diff review on macOS; git diff aee2ab3... 05190369... --check passed. GitHub’s Mobile Swift Native/Release and mobile test checks passed on this head, but none establish the timing condition. No independent native simulator result is claimed here; reviewer/native verification remains outstanding, separate from the author-actionable test defect. No other issue found in the 11-line test-only diff. Formal Request Changes is left to the human reviewer.
aee2ab3 to
7cdfda6
Compare
Stacked on #9786. Test-only.
UIViewPropertyAnimator.startAnimation()sets the views' modelalphaandtransformright away. So bothwaitUntilconditions in #9786 already hold on their first check, before anything animates. The test then starts close/open/close while the open is still running and reads the end state before any animation finishes. It never exercises a close that starts after the open has finished, which is what happens when someone closes the menu.This adds one condition to each wait: both side layers have no running animations (
layer.animationKeys()is empty). Each wait now returns once the animation finishes. The rapid close/open/close calls stay back-to-back, and the helper and assertions are unchanged.Regressions
None expected. The waits now take until the animation ends instead of returning at once. The whole test took 0.07 s on the simulator (0.03 s on #9786, about 2 s before it).
Validation
On an iOS 27 simulator, running only this test, with three temporary mutations of
JumpToLatestGlassButton.swift(never committed):guard state == .active else { return }, so a close after a finished open does nothingisReversed = trueThe first two change only code that exists today. The old one-second polling caught them only because it happened to look after the animation had finished.