--- jsr166/src/test/tck/ArrayBlockingQueueTest.java 2015/10/05 23:06:12 1.69 +++ jsr166/src/test/tck/ArrayBlockingQueueTest.java 2015/10/06 00:03:55 1.70 @@ -451,15 +451,13 @@ public class ArrayBlockingQueueTest exte final CountDownLatch aboutToWait = new CountDownLatch(1); Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { + long startTime = System.nanoTime(); for (int i = 0; i < SIZE; ++i) { - long startTime = System.nanoTime(); - assertEquals(i, (int) q.poll(2*LONG_DELAY_MS, MILLISECONDS)); - assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); + assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS)); } - long startTime = System.nanoTime(); aboutToWait.countDown(); try { - q.poll(2*LONG_DELAY_MS, MILLISECONDS); + q.poll(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (InterruptedException success) { assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); @@ -469,7 +467,7 @@ public class ArrayBlockingQueueTest exte await(aboutToWait); waitForThreadToEnterWaitState(t, LONG_DELAY_MS); t.interrupt(); - awaitTermination(t, LONG_DELAY_MS); + awaitTermination(t); checkEmpty(q); }