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)); |
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()); |
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 |
|
} |
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 |
|
} |
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 |
|
} |