title: using runClasses(), JUnit tests not shutting down after timing out if test class is public
body: <p>It seems that <code>runClasses()</code> doesn't terminate the code being tested even after the test times out and fails.</p>
  
  <p>An SSCCE:</p>
  
  <pre><code>import org.junit.Test;
  import org.junit.runner.JUnitCore;
  import org.junit.runner.Result;
  
  class Main {
      public static void main(String[] args) {
          Class&lt;?&gt;[] classes = { PublicTest.class };
          Result result = JUnitCore.runClasses(classes);
          System.out.println("Num tests: " + result.getRunCount());
          System.out.println("Time: " + result.getRunTime());
          System.out.println("Failure: " + result.getFailures().get(0));
      }
  }
  </code></pre>
  
  <p>Test class:</p>
  
  <pre><code>import org.junit.Test;
  
  public class PublicTest {
      @Test(timeout=10)
      public void loop() {
          while(true) {}
      }
  }
  </code></pre>
  
  <p>How do I get the code to terminate?</p>