1046 |
|
public void testTimedInvokeAny4() throws Exception { |
1047 |
|
final ExecutorService e = new ScheduledThreadPoolExecutor(2); |
1048 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
1049 |
+ |
long startTime = System.nanoTime(); |
1050 |
|
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
1051 |
|
l.add(new NPETask()); |
1052 |
|
try { |
1053 |
< |
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
1053 |
> |
e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS); |
1054 |
|
shouldThrow(); |
1055 |
|
} catch (ExecutionException success) { |
1056 |
|
assertTrue(success.getCause() instanceof NullPointerException); |
1057 |
|
} |
1058 |
+ |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
1059 |
|
} |
1060 |
|
} |
1061 |
|
|