https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

mengdd23

11/09/2023, 2:40 AM
Hi, is anyone meeting the same issue:
Copy code
After waiting for 10s, the test coroutine is not completing
kotlinx.coroutines.test.UncompletedCoroutinesError: After waiting for 10s, the test coroutine is not completing
It only happens when running all tests together, using
./gradlew testDebugUnitTest
When running single test class file in IDE, it works all good. It feels like the tests are running in parallel, and
runTest
will check all the coroutines to be finished when each test ends.
d

Dmitry Khalanskiy [JB]

11/09/2023, 8:42 AM
Maybe you're encountering this: https://github.com/Kotlin/kotlinx.coroutines/issues/3800 When run in parallel, tests run a bit longer, potentially triggering a timeout. Do you use mockk, by any chance?
👀 1
m

mengdd23

11/10/2023, 1:09 AM
yes, we are using mockk
3 Views