-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Since Robolectric loads fake implementations of Android framework classes, including Looper and Handler, which are responsible for running the main thread, a main dispatcher is loaded based on these classes. Since the main dispatcher is now used as the default delay controller, this causes the runTest timeout to be controlled by the fake main thread implementation as well, which results in the test timeout not working.
The same thing happens if a test dispatcher is set as the main dispatcher using the Dispatchers.setMain method in a Robolectric test. In that case, the test dispatcher becomes responsible for controlling the delay, which again results in the timeout not working.