perf(mobile): skip the post-gesture stabilization wait for a test's swipe and scroll

Merged
KD
7d ago
+215-8
  • A test's swipe and scroll now send postGestureStabilization: false, so agent-device stops holding the next read for up to 3.5 s (1.5 s poll budget plus a 2 s distrust extension) after a gesture the test checks with expect. The agent's gestures keep the wait.
  • Skipping the wait alone breaks taps: scrollUntilVisible finds the control while the list still coasts, and the tap lands on a moving list, which swallows it to stop the scroll. The step passes and nothing navigates. So the first action on a control within 2 s of a skipped wait re-reads the control every 100 ms until two reads agree on its bounds (steadied in packages/mobile/src/surface.ts). A list that already rests costs one extra snapshot.
  • fill and clear keep relocated's input checks on every re-read, and the poll stops with OPERATION_TIMEOUT when the action budget cannot fit another poll. Both came from the fresh-context review.
  • agent-device 0.21.36 ignores the option, so nothing speeds up until the dependency moves to a release that has it. The nightly 0.21.37-nightly.20261109.153 accepts it.

Verified

Ran it locally: yes

  • Surface: the built CLI on callstack/react-native-pager-view (40 tests in 16 files) on an iOS simulator (iPhone 17), cold boot per run, one build at a time, load below 2 before each run. Command: node node_modules/e2e/dist/cli/bin.js run --target ios, with node_modules/e2e and @e2e-dev/mobile pointing at the built worktrees.
  • Time is the sum of attempt durations over the 38 tests that passed in every run below. Run-to-run noise on this suite is 1 to 2%.
mainthis branch, nightly agent-devicethis branch, agent-device 0.21.36
Passed38/40, 39/40 (two runs)39/4039/40
38 common tests427.1 s, 433.0 s409.0 s (-4.7%)438.1 s (+1.9%, inside noise)
locator.tap median573 ms, 556 ms767 ms613 ms
  • The one failure in every run, issue-1096-keyboard-shrink, fails on main too (ENGINE_FAILURE, "behind the visible keyboard"). It is not this change.
  • Without the steady read, the same flag failed issue-1154-page-change-focus in 3 of 3 runs and issue-1050-back-gesture in 3 of 3 (1 of 4 on main). The first tap after a scroll got slower in exchange (714 to 767 ms against 556 to 573 ms), since the wait moved from the scroll to that tap. Lowering transition to 200 ms cut that cost but added 3 more failures, so it is not in this change.
  • The main rows ran at f4bf5299; this branch is on e27f492c, which has unrelated commits in between.
  • Tests: packages/mobile/tests/unit/engine.test.ts covers the flag per origin, the re-read until bounds agree, no re-read for the agent, a field that turns disabled after a gesture, and the budget stop.

Review

A fresh-context review (gpt-6.1-sol) found two issues, both fixed and covered by tests: the re-read dropped fill's input checks, and its 100 ms sleep ignored the operation's remaining budget.

šŸ¤– Generated with Claude Code