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.89 by jsr166, Mon May 28 21:43:48 2018 UTC vs.
Revision 1.92 by jsr166, Thu Sep 5 20:54:24 2019 UTC

# Line 69 | Line 69 | public class DelayQueueTest extends JSR1
69          // suppress [overrides] javac warning
70          public int hashCode() { return pseudodelay; }
71          public long getDelay(TimeUnit ignore) {
72 <            return Integer.MIN_VALUE + pseudodelay;
72 >            return (long) Integer.MIN_VALUE + pseudodelay;
73          }
74          public String toString() {
75              return String.valueOf(pseudodelay);
# Line 305 | Line 305 | public class DelayQueueTest extends JSR1
305      }
306  
307      /**
308 <     * timed offer does not time out
308 >     * Queue is unbounded, so timed offer never times out
309       */
310      public void testTimedOffer() throws InterruptedException {
311          final DelayQueue q = new DelayQueue();
# Line 357 | Line 357 | public class DelayQueueTest extends JSR1
357              }});
358  
359          await(pleaseInterrupt);
360 <        assertThreadBlocks(t, Thread.State.WAITING);
360 >        if (randomBoolean()) assertThreadBlocks(t, Thread.State.WAITING);
361          t.interrupt();
362          awaitTermination(t);
363      }
# Line 416 | Line 416 | public class DelayQueueTest extends JSR1
416  
417                  Thread.currentThread().interrupt();
418                  try {
419 <                    q.poll(LONG_DELAY_MS, MILLISECONDS);
419 >                    q.poll(randomTimeout(), randomTimeUnit());
420                      shouldThrow();
421                  } catch (InterruptedException success) {}
422                  assertFalse(Thread.interrupted());
# Line 432 | Line 432 | public class DelayQueueTest extends JSR1
432              }});
433  
434          await(pleaseInterrupt);
435 <        assertThreadBlocks(t, Thread.State.TIMED_WAITING);
435 >        if (randomBoolean()) assertThreadBlocks(t, Thread.State.TIMED_WAITING);
436          t.interrupt();
437          awaitTermination(t);
438          checkEmpty(q);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines