449 |
|
public void testTimedInvokeAny4() throws Exception { |
450 |
|
final ExecutorService e = new DirectExecutorService(); |
451 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
452 |
+ |
long startTime = System.nanoTime(); |
453 |
|
List<Callable<String>> l = new ArrayList<Callable<String>>(); |
454 |
|
l.add(new NPETask()); |
455 |
|
try { |
456 |
< |
e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS); |
456 |
> |
e.invokeAny(l, LONG_DELAY_MS, MILLISECONDS); |
457 |
|
shouldThrow(); |
458 |
|
} catch (ExecutionException success) { |
459 |
|
assertTrue(success.getCause() instanceof NullPointerException); |
460 |
|
} |
461 |
+ |
assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS); |
462 |
|
} |
463 |
|
} |
464 |
|
|