Repository navigation
test(ios): check the navigation glass state often instead of once a second - #9786
Conversation
🔐 Codex Security Review
Review SummaryOverall Risk: NONE
FindingsNo concrete security, correctness, or reliability findings were identified. Notes
Generated by Codex Security Review | |
wesbillman
left a comment
There was a problem hiding this comment.
🤖 Star Lord: No changes requested on aee2ab3. The source review found that main-actor polling preserves the merge and restore checks in both orientations. The first native simulator run was in progress at review time, so runtime validation is pending.
This comment has been minimized.
This comment has been minimized.
kazemek21
left a comment
There was a problem hiding this comment.
Kyle reviewed this PR and the Nexus review-tracker notes.
Posted by Codex (gpt-6.1-sol) on behalf of kylez
…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> (cherry picked from commit 0519036) Signed-off-by: Matt Toohey <contact@matttoohey.com>
aee2ab3 to
7cdfda6
Compare
…uash * origin/main: Offer image and animated avatars for human profiles (#9724) feat(mobile): add people and agents to a DM (#9153) test(ios): check the navigation glass state often instead of once a second (#9786) Co-authored-by: Eva <011987e296fd5006292d2f930b574be47c7801048d1983c46c425d3c95f0cffd@buzz.block.builderlab.xyz> Co-authored-by: Tyler Longwell <tlongwell@squareup.com> Signed-off-by: Tyler Longwell <tlongwell@squareup.com>
…ion-persist * origin/main: fix(mobile): keep Light/Dark/System on each device (#9894) Cache recently opened mobile thread replies (#9844) fix(mobile): align the New menu with desktop (#9883) fix(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (#9877) Remember collapsed sidebar sections on mobile (#9879) Add inline emoji shortcode suggestions on mobile (#9882) fix(mobile): reply to a thread's head in its open page (#9889) fix(mobile): offer linked identity import when only other backups exist (#9053) feat(mobile): enroll Android devices for push (#9811) fix(mobile): keep "+" reactions working when a new message rebuilds the row (#9831) Request sentence capitalization in the mobile composer (#9881) Offer image and animated avatars for human profiles (#9724) feat(mobile): add people and agents to a DM (#9153) test(ios): check the navigation glass state often instead of once a second (#9786) feat(mobile): add screen breadcrumbs to diagnostic reports (#9823) fix(mobile): keep error names in send, upload and invite failure text (#9855) ci(mobile): run the Mobile Swift Native lane only for native changes (#9847) Signed-off-by: Will Pfleger <wpfleger@block.xyz>
* origin/main: (23 commits) refactor(mobile): remove unused CommunityListNotifier.addCommunity (block#9896) fix(mobile): keep Light/Dark/System on each device (block#9894) Cache recently opened mobile thread replies (block#9844) fix(mobile): align the New menu with desktop (block#9883) fix(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (block#9877) Remember collapsed sidebar sections on mobile (block#9879) Add inline emoji shortcode suggestions on mobile (block#9882) fix(mobile): reply to a thread's head in its open page (block#9889) fix(mobile): offer linked identity import when only other backups exist (block#9053) feat(mobile): enroll Android devices for push (block#9811) fix(mobile): keep "+" reactions working when a new message rebuilds the row (block#9831) Request sentence capitalization in the mobile composer (block#9881) Offer image and animated avatars for human profiles (block#9724) feat(mobile): add people and agents to a DM (block#9153) test(ios): check the navigation glass state often instead of once a second (block#9786) feat(mobile): add screen breadcrumbs to diagnostic reports (block#9823) fix(mobile): keep error names in send, upload and invite failure text (block#9855) ci(mobile): run the Mobile Swift Native lane only for native changes (block#9847) Revert "perf(db): stop per-id planning of wide #e reads (block#9591)" (block#9848) feat(mobile): count networking events for diagnostics (block#9810) ... Signed-off-by: Jude Edwards <judeedwards@squareup.com>
* tmp-base: (23 commits) refactor(mobile): remove unused CommunityListNotifier.addCommunity (block#9896) fix(mobile): keep Light/Dark/System on each device (block#9894) Cache recently opened mobile thread replies (block#9844) fix(mobile): align the New menu with desktop (block#9883) fix(deps): bump url to 2.5.9 for RUSTSEC-2026-0592 (block#9877) Remember collapsed sidebar sections on mobile (block#9879) Add inline emoji shortcode suggestions on mobile (block#9882) fix(mobile): reply to a thread's head in its open page (block#9889) fix(mobile): offer linked identity import when only other backups exist (block#9053) feat(mobile): enroll Android devices for push (block#9811) fix(mobile): keep "+" reactions working when a new message rebuilds the row (block#9831) Request sentence capitalization in the mobile composer (block#9881) Offer image and animated avatars for human profiles (block#9724) feat(mobile): add people and agents to a DM (block#9153) test(ios): check the navigation glass state often instead of once a second (block#9786) feat(mobile): add screen breadcrumbs to diagnostic reports (block#9823) fix(mobile): keep error names in send, upload and invite failure text (block#9855) ci(mobile): run the Mobile Swift Native lane only for native changes (block#9847) Revert "perf(db): stop per-id planning of wide #e reads (block#9591)" (block#9848) feat(mobile): count networking events for diagnostics (block#9810) ... Signed-off-by: Jude Edwards <judeedwards@squareup.com>
Summary
Fixes a flaky native iOS test,
RunnerTests.testNavigationGlassMergesAndRestoresInBothDirections. Test-only: one file,mobile/ios/RunnerTests/RunnerTests.swift.Failure
"Mobile Swift Domain / Mobile Swift (Native)" failed on #9780 (run 44682658228):
Why it is a flake
mobile/lib/features/channelsand one Dart test. Nothing in it reachesMergingNavigationGlass.main.mainalready addresses this test. mobile: add opt-in hard-edge navigation and alignment #9260, Refine iOS composer and transcribe recordings into drafts #9574 and fix(mobile): open the channel from a thread header #9725 touchRunnerTests.swiftbut not this test or its waits.Cause
setMenuOpen(true)starts a 0.18 sUIViewPropertyAnimator. The test then waited up to 2 s for both side surfaces to reach alpha 0, usingXCTNSPredicateExpectation.That expectation evaluates its predicate about once a second. The evidence is in the passing run: the test takes 4.07 s for four waits on a 0.18 s animation, about 1 s per wait. A 2 s timeout therefore gets one or two evaluations. RunnerTests runs inside the Flutter app, and when the app holds the main thread across those evaluations the wait expires although the animation finished long before. In the failing run the 2 s timeout was reported 5.2 s after the test started, and the test's three remaining waits then passed at about 1 s each.
This is inferred from the CI timings and the code. It was not reproduced.
Fix
Both waits now use a small
waitUntilhelper in the existingXCTestCaseextension. It checks the condition every 10 ms on the main actor, for up to 10 s (the budget the other RunnerTests callbacks use since #8678 and #8741). It checks the condition before the deadline on every pass, so a main-thread stall of any length is followed by one more check instead of a timeout.The two conditions and every assertion after them are unchanged. If the surfaces never merge or restore, the test still fails, at the calling line. As a side effect the test should take about 0.4 s instead of 4 s.
Not included
BuzzPushNotificationResolverTests.testShownMessagesStayShownAcrossCommunitiesFailuresAndBurstsalso failed once onmainwith a 2 s timeout (run 44682614076). It is a different mechanism: anXCTestExpectationfulfilled by the resolver's own completion, across about 145 resolver runs, in the macOSswift teststep. The only available change is a longer timeout in a helper shared by the whole class, and the cause of the slow run is not established, so it is left out.Testing
swiftc -parseaccepts the file.git push --no-verify.buzz-review-completedis not added: agent review and human testing (AGENTS.md "Before opening a PR") have not happened.🤖 Generated with Claude Code