Skip to content

test: wait for clustered markers instead of map load in clustering tests - #1020

Merged
dkhawk merged 1 commit into
mainfrom
fix/flaky-clustering-map-loaded
Oct 1, 2026
Merged

dkhawk merged 1 commit into
mainfrom
fix/flaky-clustering-map-loaded

Conversation

@kikoso

@kikoso kikoso commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Problem

GoogleMapViewClusteringTests.testClusteringMarkerPropertiesRotationUpdatesMarker fails intermittently in Run instrumentation tests at assertThat(mapLoaded).isTrue() (line 78). It failed on #1019 today and on #1002 on Sep 30, passing on re-run, while the other 40 tests passed.

initMapAndGetMarker waits for onMapLoaded before polling for the clustered marker. onMapLoaded also waits for every tile to render, which on the macOS API 29 CI emulator sometimes takes longer than MAP_LOAD_TIMEOUT_SECONDS.

Fix

The tests only need the clustered marker, which the cluster manager adds once the map is ready, so initMapAndGetMarker now polls for the marker directly, with the same overall timeout (MAP_LOAD_TIMEOUT_SECONDS, previously 10 seconds for this poll after up to 30 for the map). The three tests in the class use this helper; their assertions are unchanged.

Testing

On a local API 34 emulator with a real key, GoogleMapViewClusteringTests passed 5 runs in a row (15/15).

initMapAndGetMarker waited for onMapLoaded, which also waits for every
tile to render, before polling for the clustered marker. On the CI
emulator tiles sometimes take longer than the timeout, so
testClusteringMarkerPropertiesRotationUpdatesMarker failed intermittently.
Poll for the marker directly with the same overall timeout.
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Coverage (unit tests)

No unit baseline recorded in coverage/history.csv yet, so this run only reports absolute numbers.

Module Line % Change Branch % Change
maps-compose 0.00% new 0.00% new
maps-compose-utils 2.04% new 0.49% new
maps-compose-widgets 0.00% new 0.00% new
TOTAL 0.42% new 0.09% new

Line and branch coverage from unit test reports. History is recorded in coverage/history.csv after each merge to main.

@googlemaps-bot

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 24.69% ❌

There is no coverage information present for the Files changed

@kikoso
kikoso marked this pull request as ready for review October 1, 2026 12:41
@dkhawk
dkhawk merged commit 109b74a into main Oct 1, 2026
13 checks passed
@dkhawk
dkhawk deleted the fix/flaky-clustering-map-loaded branch October 1, 2026 13:03
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