Skip to content

[HOLD] test(clustering): verify coroutine context injection with android-maps-robolectric - #1825

Draft
dkhawk wants to merge 2 commits into
mainfrom
test/cluster-manager-robolectric-shadows
Draft

dkhawk wants to merge 2 commits into
mainfrom
test/cluster-manager-robolectric-shadows

Conversation

@dkhawk

@dkhawk dkhawk commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Important

HOLD - DO NOT MERGE: This PR is kept as a draft and cannot be merged until the dkhawk/android-maps-robolectric repository and its testing artifacts (com.google.android.maps.robolectric:shadows) are officially released and publicly available.

Overview

This PR adds comprehensive unit and integration tests for coroutine context injection in ClusterManager (introduced in #1822) using Google Maps Robolectric shadows from android-maps-robolectric:

  • Stateful Map Lifecycle: Mounts a real MapView and extracts ShadowGoogleMap to test clustering behavior against an actual map instance headlessly.
  • Coroutine Dispatcher Verification: Verifies that clustering computations run strictly on backgroundDispatcher and UI cluster updates are delivered on mainDispatcher by asserting map markers before and after advancing TestCoroutineScheduler.
  • Cancellation & Stress Testing: Exercises rapid successive cluster() invocations to confirm that in-flight coroutines are cleanly cancelled without leaking or crashing.

@dkhawk
dkhawk requested a review from kikoso October 19, 2026 21:09
Base automatically changed from feat/cluster-manager-dispatchers to main October 20, 2026 17:18

This branch has not been deployed

No deployments
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.

2 participants