android / android/android-test
ActivityScenario.getResult() occasionally delays 45 secs
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 2
Description
### Description
Using the new `ActivityScenario` for our tests. Sadly in various occasions the `getResult()` will wait 30 seconds until it returns successfully. This behavior is not deterministic as sometimes it works again.
In both cases the result will be delivered successfully.
In cases the `getResult()` waits for 45 seconds the tested activity is already finished and the empty activity with black background is shown.
### Steps to Reproduce
The steps in our project to reproduce:
`launchActivity`
```
ActivityScenario.use{
// do the testing
// ui code finishing the activity
// retrieve `result`
result.checkResultData()
}
```
### Expected Results
It would not wait for 45 seconds but less time before retrieving the result data
### Actual Results
It freezes randomly for 45 seconds before successful result data is retrieved
### AndroidX Test and Android OS Versions
- 3.3.0-rc01
- Android 11, but also happening on Android 10
### Link to a public git repo demonstrating the problem:
-
Contributor guide
Research direction
Start at ActivityScenario.getResult() and the launchActivity flow described in the report, then reproduce the intermittent delay on Android 10 or 11. Trace the wait until the activity result is delivered and verify that the result is returned without the reported 45-second pause; the issue is stale and has no linked pull request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100