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

Include incubator modules in jtreg's view of system modules

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jtreg4.2
    • None
    • tools
    • None
    • b06

      To determine what system modules are available in the runtime image jtreg executes GetJDKProperties with `--add-modules ALL-SYSTEM`. Incubator modules are not resolved when running with the ALL-SYSTEM token. This causes jtreg to not select tests that require, through the @modules tag, an incubator module.

      The jdk.incubator.httpclient module is the only incubator module currently in JDK 9, so it can be used as an example here. Taking one test jdk/test/java/net/httpclient/BasicAuthTest.java

      $ head -32 jdk/test/java/net/httpclient/BasicAuthTest.java | tail
      /**
       * @test
       * @bug 8087112
       * @modules jdk.incubator.httpclient
       * jdk.httpserver
       * @run main/othervm BasicAuthTest
       * @summary Basic Authentication Test
       */

      $ ~/tools/jtreg/bin/jtreg -v1 -ea -esa -noreport -jdk:../../build/linux-x86_64-normal-server-release/images/jdk java/net/httpclient/BasicAuthTest.java
      Test results: no tests selected
      Results written to /home/chhegar/repos/jdk9/dev/ssMove/jdk/test/JTwork

      Note: the test is selected if run on an exploded build. This issue is specific to images since the incubator module's module-info.class has the ModuleResolution attributed added.

      A temporary workaround is to run jtreg with `-javaoptions:--add-modules=jdk.incubator.httpclient`, but this is not really an option in JPRT, or other such infrastructure.

            jjg Jonathan Gibbons
            chegar Chris Hegarty
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: