android / android/android-test

UI tests failing with MAIN_LOOPER_HAS_IDLED after androidx:core update

Open
#1,003 0 comments 11 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### Description

After upgrading to `androidx.core:core:1.5.0` some UI tests fail with the following exception on API level 26-29:
```
androidx.test.espresso.AppNotIdleException: Looped for 3663 iterations over 60 SECONDS. The following Idle Conditions failed MAIN_LOOPER_HAS_IDLED(last message: { when=-3ms callback=android.view.Choreographer$FrameDisplayEventReceiver target=android.view.Choreographer$FrameHandler }).
```

When I run the test what I see is that the button which the test should click is displayed on the screen, but some resource is not idle and Espresso is waiting for it, until it ultimately times out. Again, this happens only in some API layers (works fine on API level 23 and 30) after upgrading `androidx.core:core`.

I've noticed this issue while upgrading `androidx.core:core:1.5.0-alpha05` to `androidx.core:core:1.5.0-beta01`. I'm not sure what's causing this nor how I can provide more information, but let me know if you have any suggestions about how to debug this. It's worth pointing out that there's also a bug I've opened in the [Google issue tracker](https://issuetracker.google.com/issues/192570892).

### AndroidX Test and Android OS Versions

androidx.test: 1.3.0-1.4.0
Espresso 3.3.0-3.4.0

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reproducing the Espresso failures on API 26–29 with androidx.core:core 1.5.0-beta01, comparing API 23 and 30 and the earlier alpha05 version. Done means identifying the cause of MAIN_LOOPER_HAS_IDLED and establishing a fix or actionable resolution, using Google issue 192570892 as related context.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile-dev, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.