Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7901396

jtreg: if timeout handler throws exception, timeout is not handled at all

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • jtreg4.1
    • tools
    • None
    • b11

      When jtreg timeout handler throws exception (due to internal bug, for example), the timeout is not handled at all for the test and if the test is not going to terminate, jtreg can hang forever.

      Example code:

      public class ExceptionInTimeoutHandler extends com.sun.javatest.regtest.TimeoutHandler {
          public ExceptionInTimeoutHandler(PrintWriter jtregLog, File outputDir, File testJdk) {
              super(jtregLog, outputDir, testJdk);
          }

          @Override
          protected void runActions(Process process, long pid) throws InterruptedException {
              throw RuntimeException("will jtreg terminate?");
          }
      }

      public class Livelock {
          public static void main(String[] args) {
              for ( ;; ) {
                  try { Thread.sleep(1000); } catch (Throwable t) {}
              }
          }
      }

      $ .../jtreg -thd:<handler-class-dir> -th:ExceptionInTimeoutHandler <test-dir>/Livelock.java

            Unassigned Unassigned
            kshiroko Kirill Shirokov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: