Michal Klimczak
06/13/2022, 6:15 AMMichal Klimczak
06/13/2022, 6:15 AM//times out
@Test
fun defaultScope() = runTest(dispatchTimeoutMs = 2000L) {
this.launch {
flow<Nothing> { awaitCancellation() }.collect()
}
}
//times out
@Test
fun explicitDispatcher() = runTest(StandardTestDispatcher(), dispatchTimeoutMs = 2000L) {
this.launch {
flow<Nothing> { awaitCancellation() }.collect()
}
}
//passes
@Test
fun explicitDispatcherInner() = runTest(dispatchTimeoutMs = 2000L) {
val scope = CoroutineScope(StandardTestDispatcher())
scope.launch {
flow<Nothing> { awaitCancellation() }.collect()
}
}
tseisel
06/13/2022, 6:42 AMMichal Klimczak
06/13/2022, 6:43 AM