--- jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 02:07:32 1.77 +++ jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 02:09:57 1.78 @@ -384,9 +384,9 @@ public class ThreadPoolExecutorTest exte new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue(10)); - final CountDownLatch threadStarted = new CountDownLatch(1); - final CountDownLatch done = new CountDownLatch(1); - try { + try (PoolCleaner cleaner = cleaner(p)) { + final CountDownLatch threadStarted = new CountDownLatch(1); + final CountDownLatch done = new CountDownLatch(1); assertEquals(0, p.getPoolSize()); p.execute(new CheckedRunnable() { public void realRun() throws InterruptedException { @@ -394,11 +394,9 @@ public class ThreadPoolExecutorTest exte assertEquals(1, p.getPoolSize()); done.await(); }}); - assertTrue(threadStarted.await(SMALL_DELAY_MS, MILLISECONDS)); + assertTrue(threadStarted.await(MEDIUM_DELAY_MS, MILLISECONDS)); assertEquals(1, p.getPoolSize()); - } finally { - done.countDown(); - joinPool(p); + done.countDown(); // release pool } }