android / android/android-test
Espresso hangs with ViewAdapterFlipper and Custom Adapter with regression
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 2
Description
### Description
When trying create an Automated UI test with Espresso 3.2.0 for a ViewAdapterFlipper with a custom Adapter the test with "onData" shows the correct view on screen but then just hangs and never completes.
This is also a regression from Espresso 2.2.2 which also shows the same behaviour except it would timeout with a "android.support.test.espresso.AppNotIdleException" after 60 seconds
### Steps to Reproduce
Run the test AdaterViewFlipperTest findPage in Linked Github Repo on Android OS 5.1 on Galaxy Nexus API 22. Emulator
The test never completes.
See See https://github.com/Zardozz/AdapterViewFlipperTest/blob/master/threads_report.txt
For a dump of the running threads when the running the test under the debugger and the process is Paused while hanging.
The Debugger show "android.os.MessageQueue.nativePollOnce" as where it is paused at.
Window animation scale, Transition animation scale and Animator duration scale are all set to "off" in the emulator.
If "Show surface updates" is turned on during the test then no surface updates are shown after the correct view has been shown while the test is hanging.
### Expected Results
To complete the ViewActions or ViewAssertions on the View the Adapter has loaded and displayed.
### Actual Results
The test never ends
### AndroidX Test and Android OS Versions
```
'androidx.test:runner:1.2.0'
'androidx.test.espresso:espresso-core:3.2.0'
'androidx.test.ext:junit:1.1.1'
'androidx.test:rules:1.2.0'
```
Android OS 5.1 on Galaxy Nexus API 22. Emulator
### Link to a public git repo demonstrating the problem:
https://github.com/Zardozz/AdapterViewFlipperTest
Contributor guide
Research direction
Start by running AdapterViewFlipperTest.findPage from the linked AdapterViewFlipperTest repository on Android OS 5.1/API 22 and reproduce the hang. Read threads_report.txt alongside the test to understand the paused state. Done means the ViewActions or ViewAssertions complete after the adapter displays the expected view.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100