Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209946

[TESTBUG] CDS tests should use "@run driver"

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b14

      Description

      Most CDS tests are currently using "@run main" to run the main class. However, the main class is usually just a "script" that prepares JAR files and launches child JVM processes that do the real testing (create or use CDS archives). Usually, the main class itself is not the subject of the test.

      According to http://openjdk.java.net/jtreg/faq.html

      jtreg provides a variant of @run main that can be useful in such situations: @run driver. This is the same as @run main with the exception that any VM options specified on the command line will not be used when running the specified class.

      Many of the higher mach5 tiers use "-Xcomp", which cause significant slow down. If we run the main class with "@run driver" instead, we can reduce test execution time.

      For example, with the following patch
      diff -r 9734424da1cd test/hotspot/jtreg/runtime/appcds/customLoader/HelloCustom.java
      --- a/test/hotspot/jtreg/runtime/appcds/customLoader/HelloCustom.java Thu Aug 23 21:16:45 2018 -0700
      +++ b/test/hotspot/jtreg/runtime/appcds/customLoader/HelloCustom.java Fri Aug 24 08:39:20 2018 -0700
      @@ -35,7 +35,7 @@
        * @run driver ClassFileInstaller -jar hello.jar Hello
        * @run driver ClassFileInstaller -jar hello_custom.jar CustomLoadee
        * @run driver ClassFileInstaller -jar WhiteBox.jar sun.hotspot.WhiteBox
      - * @run main HelloCustom
      + * @run driver HelloCustom
        */

      The execution time is reduced from 30s to 17s when -Xcomp is specified.

        Attachments

          Activity

            People

            Assignee:
            iklam Ioi Lam
            Reporter:
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: