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

Comparing jsr166/src/test/tck/LinkedTransferQueueTest.java (file contents):
Revision 1.63 by jsr166, Sun Oct 4 18:49:02 2015 UTC vs.
Revision 1.64 by jsr166, Tue Oct 6 00:03:55 2015 UTC

# Line 283 | Line 283 | public class LinkedTransferQueueTest ext
283          final CountDownLatch aboutToWait = new CountDownLatch(1);
284          Thread t = newStartedThread(new CheckedRunnable() {
285              public void realRun() throws InterruptedException {
286 +                long startTime = System.nanoTime();
287                  for (int i = 0; i < SIZE; ++i) {
287                    long t0 = System.nanoTime();
288                      assertEquals(i, (int) q.poll(LONG_DELAY_MS, MILLISECONDS));
289                    assertTrue(millisElapsedSince(t0) < SMALL_DELAY_MS);
289                  }
291                long t0 = System.nanoTime();
290                  aboutToWait.countDown();
291                  try {
292 <                    q.poll(MEDIUM_DELAY_MS, MILLISECONDS);
292 >                    q.poll(LONG_DELAY_MS, MILLISECONDS);
293                      shouldThrow();
294                  } catch (InterruptedException success) {
295 <                    assertTrue(millisElapsedSince(t0) < MEDIUM_DELAY_MS);
295 >                    assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
296                  }
297              }});
298  
299          aboutToWait.await();
300 <        waitForThreadToEnterWaitState(t, SMALL_DELAY_MS);
300 >        waitForThreadToEnterWaitState(t, LONG_DELAY_MS);
301          t.interrupt();
302 <        awaitTermination(t, MEDIUM_DELAY_MS);
302 >        awaitTermination(t);
303          checkEmpty(q);
304      }
305  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines