--- jsr166/src/test/tck/ForkJoinPoolTest.java 2009/12/01 06:47:14 1.14 +++ jsr166/src/test/tck/ForkJoinPoolTest.java 2009/12/01 09:54:17 1.15 @@ -903,15 +903,23 @@ public class ForkJoinPoolTest extends JS * timed invokeAny(c) throws NullPointerException if c has null elements */ public void testTimedInvokeAny3() throws Throwable { + final CountDownLatch latch = new CountDownLatch(1); ExecutorService e = new ForkJoinPool(1); try { ArrayList> l = new ArrayList>(); - l.add(new StringTask()); + l.add(new Callable() { + public String call() { + try { + latch.await(); + } catch (InterruptedException ok) {} + return TEST_STRING; + }}); l.add(null); e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (NullPointerException success) { } finally { + latch.countDown(); joinPool(e); } }