This simple block:
runBlockingTest {
suspendCancellableCoroutine<Unit> { cont ->
thread {
Thread.sleep(1000)
cont.resume(Unit)
}
}
}
Fails with the exception:
Exception in thread "main" java.lang.IllegalStateException: This job has not completed yet
at kotlinx.coroutines.JobSupport.getCompletionExceptionOrNull(JobSupport.kt:1114)
at kotlinx.coroutines.test.TestBuildersKt.runBlockingTest(TestBuilders.kt:53)
at kotlinx.coroutines.test.TestBuildersKt.runBlockingTest$default(TestBuilders.kt:45)
at SamplKt.main(Sampl.kt:8)
at SamplKt.main(Sampl.kt)
This looks like a bug to me as it should pass.
Kotlin 1.3.31
Coroutines 1.2.1
This simple block:
runBlockingTest { suspendCancellableCoroutine<Unit> { cont -> thread { Thread.sleep(1000) cont.resume(Unit) } } }Fails with the exception:
This looks like a bug to me as it should pass.
Kotlin 1.3.31
Coroutines 1.2.1