tests use Shadows.shadowOf(Looper.getMainLooper()).idle() on stage4 and stage5.
tests can end with unexecuted task on the looper queue
Should probably be using Shadows.shadowOf(Looper.getMainLooper()).idleFor(time, TimeUnit.MILLISECONDS) or maybeShadows.shadowOf(Looper.getMainLooper()).runToEndOfTasks() instead.
tests use
Shadows.shadowOf(Looper.getMainLooper()).idle()
on stage4 and stage5.tests can end with unexecuted task on the looper queue
Should probably be using
Shadows.shadowOf(Looper.getMainLooper()).idleFor(time, TimeUnit.MILLISECONDS)
or maybeShadows.shadowOf(Looper.getMainLooper()).runToEndOfTasks()
instead.Thread.sleep may still required because of issues with shadowing of time on roboletric
also there is a questionable use of runBlocking { } probably not needed