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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.166 by jsr166, Mon Oct 5 21:39:39 2015 UTC vs.
Revision 1.170 by jsr166, Thu Oct 8 22:39:57 2015 UTC

# Line 188 | Line 188 | public class JSR166TestCase extends Test
188          return (regex == null) ? null : Pattern.compile(regex);
189      }
190  
191 +    // Instrumentation to debug very rare, but very annoying hung test runs.
192      static volatile TestCase currentTestCase;
193 +    static volatile int currentRun = 0;
194      static {
195          Runnable checkForWedgedTest = new Runnable() { public void run() {
196              // avoid spurious reports with enormous runsPerTest
# Line 197 | Line 199 | public class JSR166TestCase extends Test
199                  try { MINUTES.sleep(timeoutMinutes); }
200                  catch (InterruptedException unexpected) { break; }
201                  if (lastTestCase == currentTestCase) {
202 +                    System.err.printf(
203 +                        "Looks like we're stuck running test: %s (%d/%d)%n",
204 +                        lastTestCase, currentRun, runsPerTest);
205                      System.err.println
206                          ("Looks like we're stuck running test: "
207 <                         + lastTestCase);
207 >                         + lastTestCase + " (" + currentRun + "/" + runsPerTest + ")");
208 >                    System.err.println("availableProcessors=" +
209 >                        Runtime.getRuntime().availableProcessors());
210                      dumpTestThreads();
211                      // one stack dump is probably enough; more would be spam
212                      break;
# Line 220 | Line 227 | public class JSR166TestCase extends Test
227  
228      protected void runTest() throws Throwable {
229          for (int i = 0; i < runsPerTest; i++) {
230 +            currentRun = i;
231              if (profileTests)
232                  runTestProfiled();
233              else
# Line 826 | Line 834 | public class JSR166TestCase extends Test
834                  } finally {
835                      // last resort, for the benefit of subsequent tests
836                      pool.shutdownNow();
837 <                    pool.awaitTermination(SMALL_DELAY_MS, MILLISECONDS);
837 >                    pool.awaitTermination(MEDIUM_DELAY_MS, MILLISECONDS);
838                  }
839              }
840          } catch (SecurityException ok) {
# Line 1203 | Line 1211 | public class JSR166TestCase extends Test
1211          } finally {
1212              if (t.getState() != Thread.State.TERMINATED) {
1213                  t.interrupt();
1214 <                fail("Test timed out");
1214 >                threadFail("Test timed out");
1215              }
1216          }
1217      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines