RFR: 7903193: [jtreg] build and test failures using JDK 18

Jonathan Gibbons jjg at openjdk.org
Tue Mar 19 19:54:34 UTC 2024


On Sun, 10 Mar 2024 01:54:33 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this test only changes, which proposes to address the current failure in jtreg self tests when Java 18 or higher is used to build and test jtreg?
> 
> As noted in the following issues:
> https://bugs.openjdk.org/browse/CODETOOLS-7903193
> https://bugs.openjdk.org/browse/CODETOOLS-7903646
> https://bugs.openjdk.org/browse/CODETOOLS-7903645
> 
> these self tests in jtreg which rely on SecurityManager, no longer pass when used with Java 18 or higher, since starting Java 18 the setting of SecurityManager throws an UnsupportedOperationException.
> 
> Changes in this PR, include updates to test files which check for the Java version being used to run these tests and then decide whether or not to include some specific tests that only pass when a SecurityManager is set.
> 
> I've run these changes locally (on macos M1) and on a linux setup, both with Java 17  and Java 21. The tests all pass on these versions.
> 
> I've also run this on a headless system to make sure the `ReportOnlyTest.gmk` does indeed properly check the correct values on a headless system (both Java 17 and 21). I think this change should address the issue that Ludvig @LudwikJaniuk had run into.

It would be better to come up with a better way for `jtreg` to deal with the lack of a security manager.

That being, said, we obviously _are_ using `jtreg` to run on recent versions of JDK, and this PR is just about fixing the tests, not about changing `jtreg` functionality itself, at this time.

make/build.sh line 788:

> 786:      TESTNG_JARS="${TESTNG_JARS}"                             \\
> 787:      TESTNG_NOTICES="${TESTNG_NOTICES}"                       \\
> 788:      JAVA_SPECIFICATION_VERSION="${JAVA_SPECIFICATION_VERSION}" \\

Note the list of variables is sorted alphabetically.

test/basic/ReportOnlyTest.gmk line 38:

> 36: 	JAVA_HOME=$(JDKHOME) CLASSPATH=$(ABSCLASSDIR) \
> 37: 	    $(JTREG_IMAGEDIR)/bin/jtreg $(JTREG_OPTS) \
> 38: 	    -k:!needDisplay \

This seems unrelated to the security manager changes.

-------------

PR Review: https://git.openjdk.org/jtreg/pull/190#pullrequestreview-1947227269
PR Review Comment: https://git.openjdk.org/jtreg/pull/190#discussion_r1530984719
PR Review Comment: https://git.openjdk.org/jtreg/pull/190#discussion_r1530995415


More information about the jtreg-dev mailing list