Skip to content

test: add timeouts to patrol event waits - #793

Merged
jokerttu merged 2 commits into
route-token-integration-testfrom
patrol-event-timeouts
Nov 6, 2026
Merged

jokerttu merged 2 commits into
route-token-integration-testfrom
patrol-event-timeouts

Conversation

@jokerttu

@jokerttu jokerttu commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Bounds every event wait in the Patrol tests so a missing event fails fast with its name, instead of blocking until the 8-minute test timeout.

  • shared.dart adds withEventTimeout on Future, with eventTimeout (30 s) for events that follow promptly from an action and arrivalTimeout (60 s) for arriving at a simulated destination. startNavigationWithoutDestination uses the existing ControllerCompleter, which already times out.
  • t06 waits for the map click with a 10 s timeout instead of expectAsync1, and still fails if one tap produces several clicks.
  • t07 drops expectAsync wrappers that only added an unbounded "called at least once" wait; each listener already completes an eventReceived completer, which is now awaited with a timeout.
  • t03 and t05 bound their arrival and camera-event waits.

Before this change, Test map UI settings hung for the full 8 minutes on iOS when the map click never arrived. It now fails after 10 seconds with "Map click event was not received within 10 seconds."

Stacked on #792.

Checks run

  • Formatting and flutter analyze --fatal-infos on example/patrol_test with Flutter 3.44.9 (CI's 3.44.x).
  • iOS simulator (iPhone 17 Pro, iOS 26.5), with this change: t03 12/13, t05 3/3, t06 10/12, t07 7/7.
  • Android emulator: the first 6 t03 tests passed with this change before the emulator restarted for host-memory reasons. t05, t06 and t07 have not run on Android with this change yet; they will run in the full pass on the top of the stack.

Map click on Android. On a busy emulator, Patrol's tapAt can reach the map as a long press. The plugin then sends onMapLongClicked, so onMapClicked never fires. The test used to log the long click as "Map clicked event", which hid this. It now labels it as a long click, and a long click that arrives while the test waits for the click fails right away with "The tap was delivered as a long click, not a click." The test still requires onMapClicked.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation
  • I added new tests to check the change I am making
  • All existing and new tests are passing.

@jokerttu
jokerttu added this pull request to stack #788 November 4, 2026 14:09
@jokerttu jokerttu mentioned this pull request Nov 4, 2026
1 of 6 tasks
@jokerttu
jokerttu marked this pull request as ready for review November 5, 2026 07:16
@jokerttu
jokerttu force-pushed the patrol-event-timeouts branch from d97e594 to 30abfa8 Compare November 5, 2026 11:55
@jokerttu
jokerttu force-pushed the patrol-event-timeouts branch from 30abfa8 to 1d282b3 Compare November 5, 2026 12:12
@jokerttu
jokerttu merged commit a81f141 into main Nov 6, 2026
17 of 18 checks passed
@jokerttu
jokerttu deleted the patrol-event-timeouts branch November 6, 2026 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants