android / android/android-test

Espresso.onIdle() crashing in base.UiControllerImpl$MainThreadInterrogation.execCount

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

Description

We get this random crash from an IdlingResource called from a Kotlin Instrumented Test:

java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Attempt to read from field 'int androidx.test.espresso.base.UiControllerImpl$MainThreadInterrogation.execCount' on a null object reference
at androidx.test.espresso.Espresso.onIdle(Espresso.java:342)

I'm afraid there is no easy repro, as it's happening at random when running our instrumented test suite on an LG G6 (LG-H870 - 8.0.0) running Android 8.0 from Jenkins.

We are building with:
androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.2.0"

Contributor guide

Open the contributing guide

Research direction

Start with the stack trace at Espresso.onIdle(Espresso.java:342) and inspect UiControllerImpl$MainThreadInterrogation.execCount in Espresso 3.2.0. Try to reproduce the intermittent crash in the Kotlin instrumented test suite on Android 8.0, then verify that onIdle no longer crashes under the reported conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, kotlin
Domain
mobile, 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.