You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using 0.12.0, it appears that the virtual time of the test cannot be controlled when using runTest after the first call to awaitItem when there are multiple delay calls. Consider the following test:
This fails with the following error where indicated:
Expected no events but found Item(2)
app.cash.turbine.TurbineAssertionError: Expected no events but found Item(2)
at app//app.cash.turbine.ChannelKt.unexpectedEvent(channel.kt:258)
at app//app.cash.turbine.ChannelKt.unexpectedResult-JslgfBc(channel.kt:253)
at app//app.cash.turbine.ChannelKt.expectNoEvents(channel.kt:71)
at app//app.cash.turbine.ChannelTurbine.expectNoEvents(Turbine.kt:184)
...
This test passes, however, when using runBlocking and a manually-supplied UnconfinedTestDispatcher:
This may be related to the changes in #151, which bases logic on whether the current scope is using a test scheduler.
Kotlin version : 1.7.10
Coroutines version : 1.6.4
The text was updated successfully, but these errors were encountered:
byencho
changed the title
Can not control virtual time when using runTest
Can not control virtual time with multiple delay calls when using runTest
Oct 31, 2022
byencho
changed the title
Can not control virtual time with multiple delay calls when using runTest
Can not control virtual time for multiple delay calls when using runTest
Oct 31, 2022
When using
0.12.0
, it appears that the virtual time of the test cannot be controlled when usingrunTest
after the first call toawaitItem
when there are multipledelay
calls. Consider the following test:This fails with the following error where indicated:
This test passes, however, when using
runBlocking
and a manually-suppliedUnconfinedTestDispatcher
:This may be related to the changes in #151, which bases logic on whether the current scope is using a test scheduler.
1.7.10
1.6.4
The text was updated successfully, but these errors were encountered: