I have to restart IDE to run tests
<p>Weird bug with Android Studio 2.2 when running a single test directly in IDE - I'll either have "No tests found" or run my previously compiled test.</p>

<p>Example:</p>

<pre><code>@Test
fun testyTest() {
}
</code></pre>

<p>I'll create this test, and get the "No tests found". So I restart, and test is found! Obviously, the above test passes because it's empty. Next, I want my test to fail. So I manually throw an exception and add one line of code, below.</p>

<pre><code>@Test
fun testyTest() {
    throw RuntimeException()
}
</code></pre>

<p>Now I recompile, and this test passes too, because IntelliJ is for some reason has cached the previous test and reruns that. To get this test to properly fail - I must restart the IDE.</p>

<p>Anyone know what's going on? Note - I'm using Kotlin pretty heavily in this project.</p>

<p>EDIT 2: This is a JVM test (non-android, <code>src/test/java</code>) in an android <em>library</em> project.</p>

<p>EDIT: here's a full test class</p>

<pre><code>package com.example.zak

import org.junit.Before
import org.junit.Test


class ExampleTest {

    @Before
    fun setUp() {

    }

    @Test
    fun testyTest() {
        //throw RuntimeException()
    }
}
</code></pre>