--- jsr166/src/test/tck/ExecutorsTest.java 2019/12/16 22:55:54 1.51 +++ jsr166/src/test/tck/ExecutorsTest.java 2020/02/01 18:52:17 1.54 @@ -279,9 +279,11 @@ public class ExecutorsTest extends JSR16 Executors.newScheduledThreadPool(2), }; - final Runnable sleeper = new CheckedInterruptedRunnable() { + final CountDownLatch done = new CountDownLatch(1); + + final Runnable sleeper = new CheckedRunnable() { public void realRun() throws InterruptedException { - delay(LONG_DELAY_MS); + done.await(LONG_DELAY_MS, MILLISECONDS); }}; List threads = new ArrayList<>(); @@ -294,6 +296,7 @@ public class ExecutorsTest extends JSR16 } for (Thread thread : threads) awaitTermination(thread); + done.countDown(); for (ExecutorService executor : executors) joinPool(executor); }