You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
We already rolled back the "Main controls all delays" change: 9169d09, so this will not be an issue in the subsequent releases. You can already set the kotlinx.coroutines.main.delay system property to false to get rid of such behavior in advance.
Since Robolectric loads fake implementations of Android framework classes, including
Looper
andHandler
, 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 therunTest
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.The text was updated successfully, but these errors were encountered: