--- jsr166/src/test/tck/ForkJoinPoolTest.java 2015/10/04 08:27:41 1.63 +++ jsr166/src/test/tck/ForkJoinPoolTest.java 2015/10/05 22:54:45 1.64 @@ -548,13 +548,13 @@ public class ForkJoinPoolTest extends JS public void testInterruptedSubmit() throws InterruptedException { final CountDownLatch submitted = new CountDownLatch(1); final CountDownLatch quittingTime = new CountDownLatch(1); - final ExecutorService p = new ForkJoinPool(1); final Callable awaiter = new CheckedCallable() { public Void realCall() throws InterruptedException { - assertTrue(quittingTime.await(MEDIUM_DELAY_MS, MILLISECONDS)); + assertTrue(quittingTime.await(2*LONG_DELAY_MS, MILLISECONDS)); return null; }}; - try { + final ExecutorService p = new ForkJoinPool(1); + try (PoolCleaner cleaner = cleaner(p, quittingTime)) { Thread t = new Thread(new CheckedInterruptedRunnable() { public void realRun() throws Exception { Future future = p.submit(awaiter); @@ -562,12 +562,9 @@ public class ForkJoinPoolTest extends JS future.get(); }}); t.start(); - assertTrue(submitted.await(MEDIUM_DELAY_MS, MILLISECONDS)); + await(submitted); t.interrupt(); - t.join(); - } finally { - quittingTime.countDown(); - joinPool(p); + awaitTermination(t); } }