Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 670
Cosmina Ratiu Avatar asked Aug 13 '18 08:08

Cosmina Ratiu


2 Answers

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

like image 173
Eugene Brusov Avatar answered Nov 07 '22 10:11

Eugene Brusov


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.

like image 43
Cosmina Ratiu Avatar answered Nov 07 '22 10:11

Cosmina Ratiu