--- jsr166/src/test/tck/JSR166TestCase.java 2015/10/08 21:50:26 1.169 +++ jsr166/src/test/tck/JSR166TestCase.java 2015/10/08 22:39:57 1.170 @@ -188,7 +188,9 @@ public class JSR166TestCase extends Test return (regex == null) ? null : Pattern.compile(regex); } + // Instrumentation to debug very rare, but very annoying hung test runs. static volatile TestCase currentTestCase; + static volatile int currentRun = 0; static { Runnable checkForWedgedTest = new Runnable() { public void run() { // avoid spurious reports with enormous runsPerTest @@ -197,9 +199,12 @@ public class JSR166TestCase extends Test try { MINUTES.sleep(timeoutMinutes); } catch (InterruptedException unexpected) { break; } if (lastTestCase == currentTestCase) { + System.err.printf( + "Looks like we're stuck running test: %s (%d/%d)%n", + lastTestCase, currentRun, runsPerTest); System.err.println ("Looks like we're stuck running test: " - + lastTestCase); + + lastTestCase + " (" + currentRun + "/" + runsPerTest + ")"); System.err.println("availableProcessors=" + Runtime.getRuntime().availableProcessors()); dumpTestThreads(); @@ -222,6 +227,7 @@ public class JSR166TestCase extends Test protected void runTest() throws Throwable { for (int i = 0; i < runsPerTest; i++) { + currentRun = i; if (profileTests) runTestProfiled(); else