Skip to content

Commit ffd341a

Browse files
cipolleschimeta-codesync[bot]
authored andcommitted
Fix flaky sectionlist-viewability E2E flow on iOS (#59395)
Summary: `test_e2e_ios_rntester` on `main` keeps failing on `sectionlist-viewability.yml`, with `No visible element found: id: Brownie` on all 5 attempts. It isn't a recent regression: the same flow has failed this way regularly on `main` since at least Oct 8. **Root cause.** In the horizontal waitForInteraction step, `scrollUntilVisible` scrolls until `Brownie` is centered, with a 60s timeout: - With `direction: RIGHT`, Maestro (2.6.1, `UiElement.isElementNearScreenCenter`) counts an element as centered only when its center is left of `centerX + width/5`, which is 70% of the screen width. `Brownie` is the **last** item of the list, so its center can never get that far left (it ends at about 85% of the width). - When the element is visible but not centered, Maestro spends `maxRetryCenterCount` (4+1) more swipes before falling back to the plain `visibilityPercentage` check. - On CI each swipe moves the list by about one item and takes ~3–4s. In the recorded failure (Release, run 39903033948), scrolling starts at ~104s of the video and only reaches the end of the list at ~162s, about 58s into the 60s budget. The step then times out during the extra centering swipes, even though `Brownie` is fully on screen. Whether it passes depends on runner speed, so the flow is flaky. `flatlist-viewability.yml` has the same structure but targets `Cheesecake`, the second-to-last item, and it rarely fails. **Fix.** - Target `Cheesecake`, like the FlatList flow does. It reaches the center zone, and it's the item the next step asserts on (`output` contains `Cheesecake`). - Raise the step timeout to 120s, to give the full traverse some headroom. The Android-only vertical block is unchanged; it passes on Android. ## Changelog: [INTERNAL] [FIXED] - Fix flaky sectionlist-viewability E2E flow on iOS Pull Request resolved: #59395 Test Plan: - Looked through the iOS RNTester E2E jobs of ~225 `main` runs from Oct 8–22. `sectionlist-viewability` is by far the most common hard failure, in both Debug and Release, before and after #58991 switched the selector from text to testID. - Pulled frames from the failure recording (`e2e_ios_…_report_Release_NewArch`) to confirm the timeline above. The last frame shows the list scrolled to the end, with `Cheesecake` and `Brownie` fully visible and the output showing `Cheesecake, Brownie`. - I couldn't run Maestro locally because the network policy on my machine blocks Maestro's localhost connection to its XCTest driver. The `test_e2e_ios_rntester` jobs on this PR verify the change. Reviewed By: javache Differential Revision: D127135564 Pulled By: cipolleschi fbshipit-source-id: 675aba648bf343358aeea9cbdd359d8b5eb3b56f
1 parent 79c6c23 commit ffd341a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎packages/rn-tester/.maestro/sectionlist-viewability.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ appId: ${APP_ID} # iOS: com.meta.RNTester.localDevelopment | Android: com.facebo
2828
visible:
2929
id: 'section-list-viewability-horizontal-wait'
3030
timeout: 30000
31+
# Target the second-to-last item: the last one can never reach the center, so
32+
# `centerElement` would burn extra swipes at the end of the list.
3133
- scrollUntilVisible:
3234
element:
33-
id: 'Brownie'
35+
id: 'Cheesecake'
3436
direction: RIGHT
3537
speed: 60
3638
visibilityPercentage: 50
3739
centerElement: true
38-
timeout: 60000
40+
timeout: 120000
3941
- extendedWaitUntil:
4042
visible:
4143
id: 'output'

0 commit comments

Comments
 (0)