--- jsr166/src/test/tck/DelayQueueTest.java 2017/05/13 22:21:55 1.84 +++ jsr166/src/test/tck/DelayQueueTest.java 2017/05/29 22:44:26 1.88 @@ -234,7 +234,7 @@ public class DelayQueueTest extends JSR1 } /** - * addAll(this) throws IAE + * addAll(this) throws IllegalArgumentException */ public void testAddAllSelf() { DelayQueue q = populatedQueue(SIZE); @@ -410,10 +410,9 @@ public class DelayQueueTest extends JSR1 Thread t = newStartedThread(new CheckedRunnable() { public void realRun() throws InterruptedException { long startTime = System.nanoTime(); - for (int i = 0; i < SIZE; ++i) { + for (int i = 0; i < SIZE; i++) assertEquals(new PDelay(i), ((PDelay)q.poll(LONG_DELAY_MS, MILLISECONDS))); - } Thread.currentThread().interrupt(); try { @@ -428,11 +427,12 @@ public class DelayQueueTest extends JSR1 shouldThrow(); } catch (InterruptedException success) {} assertFalse(Thread.interrupted()); + assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); }}); await(pleaseInterrupt); - assertThreadStaysAlive(t); + assertThreadBlocks(t, Thread.State.TIMED_WAITING); t.interrupt(); awaitTermination(t); checkEmpty(q);