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

Comparing jsr166/src/test/tck/ForkJoinPoolTest.java (file contents):
Revision 1.73 by jsr166, Sat Mar 25 21:41:10 2017 UTC vs.
Revision 1.74 by jsr166, Mon May 29 19:15:02 2017 UTC

# Line 240 | Line 240 | public class ForkJoinPoolTest extends JS
240              assertFalse(p.awaitTermination(Long.MIN_VALUE, MILLISECONDS));
241              assertFalse(p.awaitTermination(-1L, NANOSECONDS));
242              assertFalse(p.awaitTermination(-1L, MILLISECONDS));
243 <            assertFalse(p.awaitTermination(0L, NANOSECONDS));
244 <            assertFalse(p.awaitTermination(0L, MILLISECONDS));
243 >            assertFalse(p.awaitTermination(randomExpiredTimeout(),
244 >                                           randomTimeUnit()));
245              long timeoutNanos = 999999L;
246              long startTime = System.nanoTime();
247              assertFalse(p.awaitTermination(timeoutNanos, NANOSECONDS));
# Line 422 | Line 422 | public class ForkJoinPoolTest extends JS
422                      done.set(true);
423                  }});
424              assertNull(future.get());
425 <            assertNull(future.get(0, MILLISECONDS));
425 >            assertNull(future.get(randomExpiredTimeout(), randomTimeUnit()));
426              assertTrue(done.get());
427              assertTrue(future.isDone());
428              assertFalse(future.isCancelled());
# Line 773 | Line 773 | public class ForkJoinPoolTest extends JS
773          ExecutorService e = new ForkJoinPool(1);
774          try (PoolCleaner cleaner = cleaner(e)) {
775              try {
776 <                e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
776 >                e.invokeAny(null, randomTimeout(), randomTimeUnit());
777                  shouldThrow();
778              } catch (NullPointerException success) {}
779          }
# Line 788 | Line 788 | public class ForkJoinPoolTest extends JS
788              List<Callable<String>> l = new ArrayList<>();
789              l.add(new StringTask());
790              try {
791 <                e.invokeAny(l, MEDIUM_DELAY_MS, null);
791 >                e.invokeAny(l, randomTimeout(), null);
792                  shouldThrow();
793              } catch (NullPointerException success) {}
794          }
# Line 802 | Line 802 | public class ForkJoinPoolTest extends JS
802          try (PoolCleaner cleaner = cleaner(e)) {
803              try {
804                  e.invokeAny(new ArrayList<Callable<String>>(),
805 <                            MEDIUM_DELAY_MS, MILLISECONDS);
805 >                            randomTimeout(), randomTimeUnit());
806                  shouldThrow();
807              } catch (IllegalArgumentException success) {}
808          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines