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

Change '7900913: new @requires tag' breaks JTreg in '-gui' mode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jtreg4.1
    • None
    • tools
    • None
    • b10

      Change 7900913 introduced the new 'RegressionContext' class which calls RegressionParameters.getTestVMJavaOptions() in its constructor. This getTestVMJavaOptions() subsequently calls getTestJavaOptions()/getTestVMOptions() which in turn may initilize the testJavaOpts/testVMOpts to new empty ArrayLists's if there exist no corresponding options.

      If JTreg runs in '-gui' mode, it calls RegressionParameters.load()/save() before executing tests. Unfortunately, saving an empty ArrayList, results in saving an empty option string (e.g. "regtest.testJavaOpts="). If such an option is loaded back, it will result in ArrayList with an empty string element (NOTICE that this is different from the empty ArrayList which was saved).

      The ArrayList with the empty string element is finally converted into a Java or VM option without a parameter (e.g. "-J ") which breaks the test execution.

      The problem can easily be reproduced by running the jdk regression test in GUI mode in following way:

      jtreg -dir:/OpenJDK/jdk9-dev/jdk/test -verbose:summary -exclude:/OpenJDK/jdk9-dev/jdk/test/ProblemList.txt -conc:2 -Xmx512m -a -ignore:quiet -timeoutFactor:5 -agentvm -gui -testjdk:/OpenJDK/output-jdk9-dev-dbg/images/j2sdk-image -w:/tmp/JTwork_jdk9_a -r:/tmp/JTreport_jdk9_a :jdk_stable

      If you now choose the test 'com/sun/jdi/BadHandshakeTest.java' for execution, it will fail in the compile step, because of an bogus '-J' option. This can be verified by looking at the "rerun" string in the test's "Test Run Message" tab.

      The problem can be easily fixed by not loading/saving "empty options" in RegressionParameters.load()/save0().

            simonis Volker Simonis
            simonis Volker Simonis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: