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)
Attachment actions
Unintended behavior
View staffing
Description
Version used: 3.0.1
What steps will reproduce the problem?
1. Declare 2 identical tests
2. register CountingIdlingResource in junit Before and unregister it in junit After
3. perform some async operation and manage idling resource before and after it
4. second test most of the time fails but only if first is run before it.
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
Android Studio, Device: Nexus 5x Os ver. 7.1.2, all animations settings set to 0.5x
What is the expected output? What do you see instead?
Expected: all tests pass
Actual: Second test fails very often
Sample project attached.
Reason:
Espresso is static and keeps outdated idling resources in IdlingResourceRegistry.
It sync its state with IdlingRegistry on first onView() operation in second test which for unknown reason (probably) unregister correct idling resource.