Android Instrumentation Tests Stuck "Running Tests" Forever Android Studio
Asked Answered
B

3

6

I use Android Espresso Tests with latest Android Studio 2.1.2 and Tests are running ok but it does not seems like the standalone test app returns back the results to reflect back to Android Studio and it shows Running Tests Forever

Bless answered 15/6, 2016 at 15:19 Comment(0)
D
8

I realize this is an old question, but I just ran into this and didn't see any other search results that had the same problem.

In my case, this was caused by the code under test having a stack overflow exception, which it seems that the test runner failed to handle. I was only able to figure it out by looking at the "Android Monitor" and looking in the logcat.

So if you get to the point where AS just sits at "running test" forever, you might want to look in logcat for an exception that the test runner couldn't handle.

Darla answered 28/3, 2017 at 17:48 Comment(2)
very helpful answer thanksObelize
In my case one test in a queue threw an error (view id was not found). Later one of the tests didn't finish forever.Nidianidicolous
R
1

You have to try removing testCoverageEnabled option from build.gradle file if it's there. possible duplicate Gradle build tool long for android Tests

Reign answered 13/9, 2017 at 9:41 Comment(0)
K
0

In case this helps anyone. In my case, I was setting the idle state wrongly(false instead of true) after doing a background task, so espresso was stuck thinking that was idle.

Kaltman answered 10/11, 2018 at 8:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.