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

Comparing jsr166/src/test/tck/ArrayBlockingQueueTest.java (file contents):
Revision 1.69 by jsr166, Mon Oct 5 23:06:12 2015 UTC vs.
Revision 1.70 by jsr166, Tue Oct 6 00:03:55 2015 UTC

# Line 451 | Line 451 | public class ArrayBlockingQueueTest exte
451          final CountDownLatch aboutToWait = new CountDownLatch(1);
452          Thread t = newStartedThread(new CheckedRunnable() {
453              public void realRun() throws InterruptedException {
454 +                long startTime = System.nanoTime();
455                  for (int i = 0; i < SIZE; ++i) {
456 <                    long startTime = System.nanoTime();
456 <                    assertEquals(i, (int) q.poll(2*LONG_DELAY_MS, MILLISECONDS));
457 <                    assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
456 >                    assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
457                  }
459                long startTime = System.nanoTime();
458                  aboutToWait.countDown();
459                  try {
460 <                    q.poll(2*LONG_DELAY_MS, MILLISECONDS);
460 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
461                      shouldThrow();
462                  } catch (InterruptedException success) {
463                      assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
# Line 469 | Line 467 | public class ArrayBlockingQueueTest exte
467          await(aboutToWait);
468          waitForThreadToEnterWaitState(t, LONG_DELAY_MS);
469          t.interrupt();
470 <        awaitTermination(t, LONG_DELAY_MS);
470 >        awaitTermination(t);
471          checkEmpty(q);
472      }
473  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines