Cosmina Ratiu
Cosmina Ratiu

Reputation: 215

Android Studio Tests are successful but do not stop junit

I am new to Android and building an app in Android Studio. I have written some tests using JUnit and Mockito.

The tests run successfully and in the run console the text Process finished with exit code 0 is shown.

However, the thread seems to remain active, the stop button is enabled and nothing happens even if I click on it. If I try to start multiple test configurations, they all remain active although the processes finish successfully.

I hope the question is clear enough... I have searched a lot for the answer and mananged to find nothing.

Upvotes: 13

Views: 1820

Answers (2)

Eugene Brusov
Eugene Brusov

Reputation: 17846

That can be fixed by following these steps:

  1. Open 'Run' tab in Android Studio
  2. Tap 'X' next to test which has just passed

Android Studio Guide

Upvotes: 9

Cosmina Ratiu
Cosmina Ratiu

Reputation: 215

Ok, so after a little more research and some more checking I have concluded that the problem stands in a visual bug of Android Studio. Apparently the tests do indeed stop, the thread running them too. The problem is purely visual.

Upvotes: 9

Related Questions