From d33a63225bf55d90329baf4015d2a33f25cf78b3 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 28 Aug 2014 17:02:27 -0400 Subject: [PATCH] Another attempt to diagnose a random test failure. (Cf. #1370.) --- cli/src/test/java/hudson/cli/ConnectionTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cli/src/test/java/hudson/cli/ConnectionTest.java b/cli/src/test/java/hudson/cli/ConnectionTest.java index 70c2e1c70f..167198a182 100644 --- a/cli/src/test/java/hudson/cli/ConnectionTest.java +++ b/cli/src/test/java/hudson/cli/ConnectionTest.java @@ -59,12 +59,14 @@ public class ConnectionTest extends Assert { t1.join(9999); t2.join(9999); + if (e != null) { + throw e; + } + if (t1.isAlive() || t2.isAlive()) { t1.interrupt(); t2.interrupt(); throw new Error("thread is still alive"); } - - if (e!=null) throw e; } }