Repository navigation
Commit ffd341a
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: 675aba648bf343358aeea9cbdd359d8b5eb3b56f1 parent 79c6c23 commit ffd341a
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | | - | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
0 commit comments