Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used: 3.0.1
What steps will reproduce the problem?
1. register CountingIdlingResource in IdlingRegistry.getInstance().register()
2. launch Activity in test which performs some async operation (in worker thread which is monitored by CountingIdlingResource registered in previous step )
3. dont't use any of Espresso.onView, onData, registerIdlingResources
4. use Espresso.onIdle to check something not related with UI which should happen after async operation
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
Android Studio
What is the expected output? What do you see instead?
Expected: test passed
Actual: test fail because onIdle does not wait for CountingIdlingResource
Reason:
Espresso registers IdlingResource's from IdlingRegistry to IdlingResourceRegistry by nvoking IdlingResourceRegistry.sync method. It does not invoke it in onIdle.
Everything works as expected if before onIdle there is Espresso.onView call.