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

Comparing jsr166/src/test/tck/ForkJoinTask8Test.java (file contents):
Revision 1.28 by jsr166, Sat Mar 18 20:42:20 2017 UTC vs.
Revision 1.29 by jsr166, Mon May 29 19:15:02 2017 UTC

# Line 5 | Line 5
5   */
6  
7   import static java.util.concurrent.TimeUnit.MILLISECONDS;
8 import static java.util.concurrent.TimeUnit.SECONDS;
8  
9   import java.util.Arrays;
10   import java.util.concurrent.CountDownLatch;
# Line 104 | Line 103 | public class ForkJoinTask8Test extends J
103                           ((BinaryAsyncAction)a).getForkJoinTaskTag());
104  
105          try {
106 <            a.get(0L, SECONDS);
106 >            a.get(randomExpiredTimeout(), randomTimeUnit());
107              shouldThrow();
108          } catch (TimeoutException success) {
109          } catch (Throwable fail) { threadUnexpectedException(fail); }
# Line 129 | Line 128 | public class ForkJoinTask8Test extends J
128              Thread.currentThread().interrupt();
129              long startTime = System.nanoTime();
130              assertSame(expected, a.join());
131 <            assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS);
131 >            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
132              Thread.interrupted();
133          }
134  
# Line 137 | Line 136 | public class ForkJoinTask8Test extends J
136              Thread.currentThread().interrupt();
137              long startTime = System.nanoTime();
138              a.quietlyJoin();        // should be no-op
139 <            assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS);
139 >            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
140              Thread.interrupted();
141          }
142  
# Line 145 | Line 144 | public class ForkJoinTask8Test extends J
144          assertFalse(a.cancel(true));
145          try {
146              assertSame(expected, a.get());
147 <        } catch (Throwable fail) { threadUnexpectedException(fail); }
149 <        try {
150 <            assertSame(expected, a.get(5L, SECONDS));
147 >            assertSame(expected, a.get(randomTimeout(), randomTimeUnit()));
148          } catch (Throwable fail) { threadUnexpectedException(fail); }
149      }
150  
# Line 175 | Line 172 | public class ForkJoinTask8Test extends J
172          {
173              long startTime = System.nanoTime();
174              a.quietlyJoin();        // should be no-op
175 <            assertTrue(millisElapsedSince(startTime) < SMALL_DELAY_MS);
175 >            assertTrue(millisElapsedSince(startTime) < LONG_DELAY_MS);
176          }
177  
178          try {
# Line 186 | Line 183 | public class ForkJoinTask8Test extends J
183          } catch (Throwable fail) { threadUnexpectedException(fail); }
184  
185          try {
186 <            a.get(5L, SECONDS);
186 >            a.get(randomTimeout(), randomTimeUnit());
187              shouldThrow();
188          } catch (ExecutionException success) {
189              assertSame(t.getClass(), success.getCause().getClass());
# Line 488 | Line 485 | public class ForkJoinTask8Test extends J
485                  AsyncFib f = new AsyncFib(8);
486                  assertSame(f, f.fork());
487                  try {
488 <                    f.get(5L, null);
488 >                    f.get(randomTimeout(), null);
489                      shouldThrow();
490                  } catch (NullPointerException success) {}
491              }};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines