ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/DelayQueueTest.java
(Generate patch)

Comparing jsr166/src/test/tck/DelayQueueTest.java (file contents):
Revision 1.83 by jsr166, Sat May 13 21:43:50 2017 UTC vs.
Revision 1.86 by jsr166, Sun May 14 00:48:20 2017 UTC

# Line 428 | Line 428 | public class DelayQueueTest extends JSR1
428                      shouldThrow();
429                  } catch (InterruptedException success) {}
430                  assertFalse(Thread.interrupted());
431 +
432                  assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
433              }});
434  
435          await(pleaseInterrupt);
436 <        assertThreadStaysAlive(t);
436 >        assertThreadBlocks(t, Thread.State.TIMED_WAITING);
437          t.interrupt();
438          awaitTermination(t);
439          checkEmpty(q);
# Line 713 | Line 714 | public class DelayQueueTest extends JSR1
714      public void testTimedPollDelayed() throws InterruptedException {
715          DelayQueue q = new DelayQueue();
716          q.add(new NanoDelay(LONG_DELAY_MS * 1000000L));
717 +        long startTime = System.nanoTime();
718          assertNull(q.poll(timeoutMillis(), MILLISECONDS));
719 +        assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
720      }
721  
722      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines