Related question to the above: thank you to Ivan, using suspendCoroutine works well from commonTest running against Android or JVM, but when I try to run against iosSimulator64Test, it never finishes. See thread:
tylerwilson
08/02/2024, 1:00 PM
Here is the test:
Copy code
@Test
fun getBlockReasons() = runTest {
val reasons = suspendCoroutine { continuation ->
Network().getBlockReasons(null, auth) { reasons, exception ->
reasons.let {
continuation.resume(it)
}
exception?.let {
continuation.resumeWithException(exception)
}
}
}
assertTrue(reasons.isNotEmpty(), "Reasons returned is empty.")
}
and the test just spins forever:
tylerwilson
08/02/2024, 1:02 PM
Also, I have other unit tests that do not use runTest that run successfully against iOS with no issue. So it seems something to do with coroutines perhaps.
e
Edoardo Luppi
08/07/2024, 12:50 PM
Better report it on YT if you haven't solved it yet.