--- jsr166/src/test/tck/RecursiveActionTest.java 2017/03/18 18:20:00 1.49 +++ jsr166/src/test/tck/RecursiveActionTest.java 2017/05/29 19:15:02 1.50 @@ -4,7 +4,7 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.concurrent.TimeUnit.MILLISECONDS; import java.util.Arrays; import java.util.HashSet; @@ -73,14 +73,14 @@ public class RecursiveActionTest extends Thread.currentThread().interrupt(); try { - a.get(5L, SECONDS); + a.get(randomTimeout(), randomTimeUnit()); shouldThrow(); } catch (InterruptedException success) { } catch (Throwable fail) { threadUnexpectedException(fail); } } try { - a.get(0L, SECONDS); + a.get(randomExpiredTimeout(), randomTimeUnit()); shouldThrow(); } catch (TimeoutException success) { } catch (Throwable fail) { threadUnexpectedException(fail); } @@ -98,9 +98,7 @@ public class RecursiveActionTest extends assertFalse(a.cancel(true)); try { assertNull(a.get()); - } catch (Throwable fail) { threadUnexpectedException(fail); } - try { - assertNull(a.get(5L, SECONDS)); + assertNull(a.get(randomTimeout(), randomTimeUnit())); } catch (Throwable fail) { threadUnexpectedException(fail); } } @@ -125,7 +123,7 @@ public class RecursiveActionTest extends } catch (Throwable fail) { threadUnexpectedException(fail); } try { - a.get(5L, SECONDS); + a.get(randomTimeout(), randomTimeUnit()); shouldThrow(); } catch (CancellationException success) { } catch (Throwable fail) { threadUnexpectedException(fail); } @@ -156,7 +154,7 @@ public class RecursiveActionTest extends } catch (Throwable fail) { threadUnexpectedException(fail); } try { - a.get(5L, SECONDS); + a.get(randomTimeout(), randomTimeUnit()); shouldThrow(); } catch (ExecutionException success) { assertSame(t.getClass(), success.getCause().getClass()); @@ -442,7 +440,7 @@ public class RecursiveActionTest extends protected void realCompute() throws Exception { FibAction f = new FibAction(8); assertSame(f, f.fork()); - assertNull(f.get(5L, SECONDS)); + assertNull(f.get(LONG_DELAY_MS, MILLISECONDS)); assertEquals(21, f.result); checkCompletedNormally(f); }}; @@ -458,7 +456,7 @@ public class RecursiveActionTest extends FibAction f = new FibAction(8); assertSame(f, f.fork()); try { - f.get(5L, null); + f.get(randomTimeout(), null); shouldThrow(); } catch (NullPointerException success) {} }}; @@ -577,7 +575,7 @@ public class RecursiveActionTest extends FailingFibAction f = new FailingFibAction(8); assertSame(f, f.fork()); try { - f.get(5L, SECONDS); + f.get(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (ExecutionException success) { Throwable cause = success.getCause(); @@ -669,7 +667,7 @@ public class RecursiveActionTest extends assertTrue(f.cancel(true)); assertSame(f, f.fork()); try { - f.get(5L, SECONDS); + f.get(LONG_DELAY_MS, MILLISECONDS); shouldThrow(); } catch (CancellationException success) { checkCancelled(f);