Mikołaj Kąkol
06/04/2021, 12:55 PMkotin-coroutines-native-mt
? I’m trying to update to 1.5.0 from 1.4.2, and my tests are failing left and right with mutation attempt of frozen kotlinx.coroutines.flow.StateFlowImpl
Mikołaj Kąkol
06/04/2021, 12:57 PM@Test
fun testSingleThreadWithFreeze() {
val f = MutableStateFlow(1)
f.value = 2
f.freeze()
f.value = 3
runBlocking {
f.take(1).collect {
println("got $it")
}
println("got ${f.value}")
}
}
example of test that used to workMikołaj Kąkol
06/04/2021, 9:26 PMkotest
and turbine
dependencies that brings non-mt version into the compilation process and that lib is used instead of mt one.Mikołaj Kąkol
06/04/2021, 9:26 PMimplementation(Libs.Kotlin.coroutines) {
version { strictly(Versions.Kotlin.coroutines) }
}
fixes issue