--- jsr166/src/test/tck/JSR166TestCase.java 2015/10/03 19:19:01 1.151 +++ jsr166/src/test/tck/JSR166TestCase.java 2015/10/03 19:59:49 1.155 @@ -461,7 +461,6 @@ public class JSR166TestCase extends Test } else { return new TestSuite(); } - } // Delays for timing-dependent tests, in milliseconds. @@ -519,6 +518,7 @@ public class JSR166TestCase extends Test * the same test have no effect. */ public void threadRecordFailure(Throwable t) { + threadDump(); threadFailure.compareAndSet(null, t); } @@ -529,7 +529,7 @@ public class JSR166TestCase extends Test void tearDownFail(String format, Object... args) { String msg = toString() + ": " + String.format(format, args); System.err.println(msg); - printAllStackTraces(); + threadDump(); throw new AssertionFailedError(msg); } @@ -598,7 +598,7 @@ public class JSR166TestCase extends Test fail(reason); } catch (AssertionFailedError t) { threadRecordFailure(t); - fail(reason); + throw t; } } @@ -800,7 +800,7 @@ public class JSR166TestCase extends Test * A debugging tool to print all stack traces, as jstack does. * Uninteresting threads are filtered out. */ - static void printAllStackTraces() { + static void threadDump() { ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); System.err.println("------ stacktrace dump start ------"); for (ThreadInfo info : threadMXBean.dumpAllThreads(true, true)) {