Any tips on testing the Flow from a ConflatedBroadcastChannel?
Seems like this test hangs,
Copy code
val ch = BroadcastChannel<Int>(Channel.CONFLATED)
var counter = 0
ch.asFlow().onEach { ++counter; yield() }.launchIn(this)
ch.offer(150) // send random element
yield()
counter shouldBeExactly 1
this
in launchIn() is TestContext of kotest framework: https://github.com/kotest/kotest (probably single threaded)
but I assume yielding will change the coroutine to the waiting coroutine, right?
f
flosch
09/27/2020, 1:35 PM
#kotest
a
Animesh Sahu
09/27/2020, 1:59 PM
Don't think its really connected to the testing framework...(I'll try to cross-post)