diff --git a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/call/CallManagerTest.kt b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/call/CallManagerTest.kt index dfa40002e8..fab6868d6e 100644 --- a/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/call/CallManagerTest.kt +++ b/commons/src/commonTest/kotlin/com/vitorpamplona/amethyst/commons/call/CallManagerTest.kt @@ -36,6 +36,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.Job import kotlinx.coroutines.launch import kotlinx.coroutines.test.TestScope +import kotlinx.coroutines.test.UnconfinedTestDispatcher import kotlinx.coroutines.test.advanceTimeBy import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest @@ -108,13 +109,13 @@ class CallManagerTest { */ private fun TestScope.collectSessionEvents(manager: CallManager): Pair, Job> { val events = mutableListOf() - val job = launch { manager.sessionEvents.collect { events.add(it) } } + val job = launch(UnconfinedTestDispatcher(testScheduler)) { manager.sessionEvents.collect { events.add(it) } } return events to job } private fun TestScope.collectRenegotiationEvents(manager: CallManager): Pair, Job> { val events = mutableListOf() - val job = launch { manager.renegotiationEvents.collect { events.add(it) } } + val job = launch(UnconfinedTestDispatcher(testScheduler)) { manager.renegotiationEvents.collect { events.add(it) } } return events to job }