--- old/test/java/lang/ProcessBuilder/Basic.java Thu Dec 5 13:56:16 2013 +++ new/test/java/lang/ProcessBuilder/Basic.java Thu Dec 5 13:56:15 2013 @@ -2240,23 +2240,32 @@ final Process p = new ProcessBuilder(childArgs).start(); final long start = System.nanoTime(); final CountDownLatch latch = new CountDownLatch(1); + final CountDownLatch done = new CountDownLatch(1); final Thread thread = new Thread() { public void run() { try { + final boolean result; try { latch.countDown(); - p.waitFor(30000, TimeUnit.MILLISECONDS); + result = p.waitFor(30000, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { return; } - fail("waitFor() wasn't interrupted"); - } catch (Throwable t) { unexpected(t); }}}; + fail("waitFor() wasn't interrupted, its return value was: " + result); + } catch (Throwable t) { + unexpected(t); + } finally { + done.countDown(); + } + } + }; thread.start(); latch.await(); Thread.sleep(1000); thread.interrupt(); + done.await(); p.destroy(); } catch (Throwable t) { unexpected(t); }