Fix flaky VerificationCodeScreenTest overflow menu test#6139
Closed
SaintPatrck wants to merge 2 commits intomainfrom
Closed
Fix flaky VerificationCodeScreenTest overflow menu test#6139SaintPatrck wants to merge 2 commits intomainfrom
SaintPatrck wants to merge 2 commits intomainfrom
Conversation
Replace .isDisplayed() with .assertIsDisplayed() in the overflow menu verification test to properly wait for Compose recomposition before asserting. The previous matcher returned immediately without waiting, causing FutureGarbageCollectedException when popup rendering was slow. This aligns with the established pattern used in other menu interaction tests in the same file. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Claude finished @SaintPatrck's task —— View job Review CompleteOverall Assessment: APPROVE Correctly replaces |
Contributor
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6139 +/- ##
==========================================
- Coverage 84.97% 84.97% -0.01%
==========================================
Files 723 723
Lines 52746 52744 -2
Branches 7649 7649
==========================================
- Hits 44822 44820 -2
Misses 5250 5250
Partials 2674 2674 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| .onAllNodesWithText(text = "Lock") | ||
| .filterToOne(hasAnyAncestor(isPopup())) | ||
| .isDisplayed() | ||
| .assertIsDisplayed() |
Collaborator
There was a problem hiding this comment.
We definitely do this in other tests too.
Add `assertIsDisplayed()` before performing an accessibility action in the landscape orientation test. This ensures the Compose UI has fully settled before interaction. The test was failing intermittently due to the UI not being ready before the test attempted to perform the action, leading to flaky behavior. This explicit assertion provides the necessary synchronization to create a more robust test.
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.

🎟️ Tracking
N/A
📔 Objective
Fix flaky VerificationCodeScreenTest > on overflow item click should display menu test that intermittently fails with FutureGarbageCollectedException in CI.
Root Cause: The test used .isDisplayed() matcher which returns immediately without waiting for Compose recomposition, creating a race condition with asynchronous popup rendering.
Solution: Replace .isDisplayed() with .assertIsDisplayed() to properly wait for the Compose UI to settle before verification. This aligns with the established pattern used in other menu interaction tests within the same file (lines 426-455).
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes