You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TECHNICAL] Migrate tests to the new kotlinx-coroutines-test API #4710
We’ve noticed that when some libraries are added to the project, the kotlinx-coroutines-test dependency is automatically updated, causing some unit tests to fail to compile due to errors in methods like pauseDispatcher() and resumeDispatcher().
Starting from 1.8.0 (we are currently using 1.6.4), the TestCoroutineDispatcher may not be available and the methods mentioned before may be removed, so that is the main reason. As a result, some tests from AuthenticationViewModelTest, OAuthViewModelTest, CapabilityViewModelTest and ShareViewModelTest need to be refactored due to this restriction.
changed the title [-][TECHNICAL] Migrate tests to the new `kotlinx-coroutines-test` API[/-][+][TECHNICAL] Migrate tests to the new kotlinx-coroutines-test API[/+]on Nov 6, 2025
Tests from AuthenticationViewModelTest, OAuthViewModelTest, CapabilityViewModelTest and ShareViewModelTest have been refactored in order to use the new kotlinx-coroutines-test API. The main changes introduced in this issue include:
Upgrade version from 1.6.4 to 1.9.0
Remove pauseDispatcher() and resumeDispatcher() methods.
Replace TestCoroutineDispatcher by StandardTestDispatcher
Use runTest { } for tests that are using coroutines.
Activity
[-][TECHNICAL] Migrate tests to the new `kotlinx-coroutines-test` API[/-][+][TECHNICAL] Migrate tests to the new kotlinx-coroutines-test API[/+]joragua commentedon Nov 19, 2025
Summary
Tests from
AuthenticationViewModelTest,OAuthViewModelTest,CapabilityViewModelTestandShareViewModelTesthave been refactored in order to use the newkotlinx-coroutines-testAPI. The main changes introduced in this issue include:1.6.4to1.9.0pauseDispatcher()andresumeDispatcher()methods.TestCoroutineDispatcherbyStandardTestDispatcherrunTest { }for tests that are using coroutines.advanceUntilIdle()to run the enqueued tasks in the specified order.https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-test/kotlinx.coroutines.test/-test-coroutine-scheduler/advance-until-idle.html