简体   繁体   中英

Terminated test status without any failure message in Android Studio 2.0 while unit testing

Issue:

I upgraded to Android Studio 2.0 from 1.5 yesterday on Ubuntu. When I unit-test in Android Studio 2.0, it shows Terminated test status even though all tests are passed. Sometimes it shows only some of the tests passed. I'm pretty sure my code is working and tests are correct, because I had same setup on Android Studio 1.5.

For example I have 22 tests. Sometimes it shows all 22 tests passed , on the next run it shows 21 of 22 tests passed , sometimes Stopped. 20 of 22 tests passed , other times it shows all 20 tests passed even though I have 22 test. It all happens randomly. No failure message is shown.

Tried solutions so far:

I found an answer about Android studio on a similar IntelliJ issue that turning off Instant Run to Hot Swap resolves the issue. But that didn't solve the problem.

I tried running tests in Android Studio 1.5 but no problems.

Has anyone encountered any such issues in Android Studio 2.0, did you find any fix for this? Any help is much appreciated. Thanks!

This sounds like a known bug. The description on the bug report does not indicate some test not being run occasionally though.[1] I am running into similar issues but all the tests are run.

There seems to be a fix on the way probably in Android Studio 2.1.

[1] https://code.google.com/p/android/issues/detail?id=201968

I would like to confirm that Android Studio 2.1 has been released. I just updated to Android Studio 2.1 and Android Gradle plugin 2.1.0 and this issue has been fixed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM