Testing Coroutines runBlockingTest time
问题 Using this manual to test Coroutines using runBlockingTest . I encountered some issues. If the coroutine created by launch or async calls delay then the runBlockingTest will not auto-progress time right away. This allows tests to observe the interaction of multiple coroutines with different delays. @Test fun testFooWithLaunchAndDelay() = runBlockingTest { foo() // the coroutine launched by foo has not completed here, it is suspended waiting for delay(1_000) advanceTimeBy(1_000) // progress