--- jsr166/src/test/tck/JSR166TestCase.java 2015/10/03 19:19:01 1.151 +++ jsr166/src/test/tck/JSR166TestCase.java 2015/10/03 19:39:16 1.154 @@ -519,6 +519,7 @@ public class JSR166TestCase extends Test * the same test have no effect. */ public void threadRecordFailure(Throwable t) { + threadDump(); threadFailure.compareAndSet(null, t); } @@ -529,7 +530,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 +599,7 @@ public class JSR166TestCase extends Test fail(reason); } catch (AssertionFailedError t) { threadRecordFailure(t); - fail(reason); + throw t; } } @@ -800,7 +801,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)) {