https://kotlinlang.org logo
Title
r

rook

01/30/2020, 9:34 PM
I’m trying to prove out converting from a
Flow
to an Rx construct. Unfortunately, this never seems to complete.
z

zak.taccardi

01/30/2020, 9:36 PM
your
.collect
on the channel will not complete until the channel is closed
so the job stays active
r

rook

01/30/2020, 9:37 PM
Gotcha. So, I guess the question is, how do I tell the test not to end without processing all the signals?
z

zak.taccardi

01/30/2020, 9:38 PM
try
runBlockingTest
and don’t
.join
maybe?
and launch in the same
CoroutineScope
errr
CoroutineContext
, not
Dispatchers.Default
r

rook

01/30/2020, 9:42 PM
runBlockingTest
unfortunately causes a crash.
This job has not completed yet
d

Dustin Lam

01/31/2020, 2:15 AM
You could save a reference to the job and cancel it at the end of the test