Repository navigation
Flaky UI test: LargeInventoryTests fails clicking the last scrolled row #182
Description
What
LargeInventoryTests.testLargeInventorySupportsNavigationAndLifecycleWorkflows intermittently fails at BerthlyUITests/LargeInventoryTests.swift:46, the tailContainer.click() on computeRow-container-099 after the compute list is scrolled to the bottom. All three known occurrences were on macOS 27, and it has not failed on the macOS 26 CI leg.
Not related to the line 31 Escape failure on macOS 27 that #175 fixed. That was a different bug in the same test.
Evidence
| # | Where | Message |
|---|---|---|
| 1 | local, macOS 27.0, one failure in 6 standalone runs | Not hittable: StaticText, {{inf, inf}, {0.0, 0.0}}, identifier: 'computeRow-container-099' |
| 2 | local, macOS 27.0, full UI suite | Unable to find hit point for StaticText, identifier: 'computeRow-container-099' ... invalid frame for element and/or containing scroll view ScrollView. Passed 4 of 4 standalone reruns. |
| 3 | CI UI tests (macOS 27, advisory), PR #181 attempt 1 (run 37319951718, after 52.9 s) |
Not hittable: StaticText, {{0.0, 768.0}, {0.0, 0.0}}, identifier: 'computeRow-container-099'. Passed on rerun of the same commit. |
CI executions of each UI leg across PRs #175 to #181 on 2026-10-05:
| Leg | Executions | Failures |
|---|---|---|
| macOS 26, mock mode | 8 | 0 |
| macOS 27, advisory | 8 | 1 |
All three failures have the same shape: the row resolves to a degenerate frame (zero size, at inf or y=768) at click time.
Where
Lines 36 to 46 of LargeInventoryTests.swift. The test scrolls the outline with scroll(byDeltaY: -10_000) three times, waits for hittable == true on computeRow-container-099 with a 5 s expectation, then clicks. The wait passes and the click then reports the element not hittable, so the frame goes bad between the check and the click.
This is a hypothesis, not confirmed: rows in the 100+ item list being recycled or re-laid out after programmatic scrolling. The test already carries a comment about a related "stale/degenerate frame" race on the very last row (machine-018), which it avoids by clicking container-099 instead. The same class of problem still happens one row higher.
Impact
The advisory macOS 27 UI leg goes red intermittently, about 1 execution in 8 so far, and each rerun costs about 30 minutes. ci.yml plans to promote the macOS 27 legs to required gates once they have a green track record, and this is the only flake that has stood in the way so far.
Ideas, none tried
- Re-resolve the row and retry the scroll and click as one unit, instead of check-then-click.
- Bring the row into view with the existing filter (
setComputeFilter("container-099", ...), which the test already uses elsewhere) instead of scrolling to the end of a long list. - Check whether the dataset size matters: the large fixture has 100 containers plus machines.
Repro
Intermittent, observed once in 6 local runs. Loop the single test:
for i in $(seq 1 12); do
xcodebuild test -project Berthly.xcodeproj -scheme Berthly -destination 'platform=macOS' \
-only-testing:BerthlyUITests/LargeInventoryTests/testLargeInventorySupportsNavigationAndLifecycleWorkflows
done
Activity
henrywang commentedon Oct 6, 2026
Fourth occurrence, on the macOS 27 advisory UI leg of PR #185 (run 37472765680, job 112300263078): same line 46,
Not hittable: StaticText, {{0.0, 768.0}, {0.0, 0.0}}, identifier: 'computeRow-container-099'. The other 81 UI tests on that leg passed. The PR changes only the toolbar, and the macOS 26 UI leg passed. CI count on the macOS 27 leg is now 2 failures in 10 runs.henrywang commentedon Oct 7, 2026
Fifth occurrence, macOS 27 advisory UI leg of PR #186 (run 37596856143): same line 46,
Not hittable: StaticText, {{0.0, 768.0}, {0.0, 0.0}}, identifier: 'computeRow-container-099'. The other 81 UI tests passed; the macOS 26 UI leg passed. macOS 27 leg CI count is now 3 failures in 11 runs.henrywang commentedon Oct 10, 2026
Sixth occurrence, and the first on the macOS 26 leg ("UI tests (mock mode)", PR #188, run 38023718968): same line 46,
Not hittable: StaticText, {{0.0, 768.0}, {0.0, 0.0}}, identifier: 'computeRow-container-099'. The other 81 UI tests passed. So this is not macOS 27-specific; I've dropped "on macOS 27" from the title. Both UI legs are advisory (only unit tests are required, per CONTRIBUTING), so it still warns rather than blocks, but it now shows up on both OSes.[-]Flaky UI test: LargeInventoryTests fails clicking the last scrolled row on macOS 27[/-][+]Flaky UI test: LargeInventoryTests fails clicking the last scrolled row[/+]fix: open the tail container through the filter in LargeInventoryTests (