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

Comparing jsr166/src/test/tck/SynchronousQueueTest.java (file contents):
Revision 1.33 by dl, Fri May 6 11:22:07 2011 UTC vs.
Revision 1.34 by jsr166, Sat May 21 06:24:33 2011 UTC

# Line 211 | Line 211 | public class SynchronousQueueTest extend
211          final CountDownLatch pleaseInterrupt = new CountDownLatch(1);
212          Thread t = newStartedThread(new CheckedRunnable() {
213              public void realRun() throws InterruptedException {
214 <                long t0 = System.nanoTime();
215 <                assertFalse(q.offer(new Object(), SHORT_DELAY_MS, MILLISECONDS));
216 <                assertTrue(millisElapsedSince(t0) >= SHORT_DELAY_MS);
214 >                long startTime = System.nanoTime();
215 >                assertFalse(q.offer(new Object(), timeoutMillis(), MILLISECONDS));
216 >                assertTrue(millisElapsedSince(startTime) >= timeoutMillis());
217                  pleaseInterrupt.countDown();
218                t0 = System.nanoTime();
218                  try {
219 <                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
219 >                    q.offer(new Object(), 2 * LONG_DELAY_MS, MILLISECONDS);
220                      shouldThrow();
221                  } catch (InterruptedException success) {}
223                assertTrue(millisElapsedSince(t0) < MEDIUM_DELAY_MS);
222              }});
223  
224 <        assertTrue(pleaseInterrupt.await(MEDIUM_DELAY_MS, MILLISECONDS));
224 >        await(pleaseInterrupt);
225          t.interrupt();
226 <        awaitTermination(t, MEDIUM_DELAY_MS);
226 >        awaitTermination(t);
227      }
228  
229      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines