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.
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.