Skip to content

Conversation

@agrognetti
Copy link
Contributor

@agrognetti agrognetti commented Nov 10, 2025

Summary

This commit replaces direct calls to kotlinx.coroutines.Dispatchers with a DispatcherProvider abstraction. This change facilitates testing by allowing coroutine dispatchers to be overridden.

How did you test this change?

These changes are part of the test suite

Are there any deployment considerations?

No


Note

Replace direct coroutine dispatcher usage with an injectable provider, and add test hooks and e2e rule to override dispatchers in tests.

  • SDK:
    • Replace direct Dispatchers usage with DispatcherProviderHolder.current.io in InstrumentationManager, GraphQLClient, and RRwebGraphQLReplayLogExporter.
    • Add coroutines/DispatcherProvider abstraction and DispatcherProviderHolder.
  • Testing:
    • Add test fixture ObservabilityDispatcherTestHooks to override SDK dispatchers.
    • Introduce TestCoroutineRule in e2e tests; update SamplingE2ETest to use @Rule and runTest.
    • Minor test cleanup in DisablingConfigOptionsE2ETest (null-check compactness).
  • Build/Config:
    • Enable testFixtures in lib/build.gradle.kts; add testFixturesImplementation for coroutines-test.
    • In e2e app, depend on testFixtures(project(":observability-android")).
    • Set android.experimental.enableTestFixturesKotlinSupport=true in gradle.properties.

Written by Cursor Bugbot for commit a2e32b5. This will update automatically on new commits. Configure here.

…testing

This commit replaces direct calls to `kotlinx.coroutines.Dispatchers` with a `DispatcherProvider` abstraction. This change facilitates testing by allowing coroutine dispatchers to be overridden.
@agrognetti agrognetti merged commit 629bc39 into main Nov 12, 2025
23 checks passed
@agrognetti agrognetti deleted the agrognetti/O11Y-741 branch November 12, 2025 15:10
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