RFR: 8274166: Some CDS tests ignore -Dtest.cds.runtime.options [v4]
David Holmes
dholmes at openjdk.org
Wed Apr 5 02:01:18 UTC 2023
On Tue, 4 Apr 2023 20:57:14 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> The test.cds.runtime.options property is used to execute the CDS tests in a special mode. E.g., create the archived with G1 but load the archive with EpsilonGC.
>>
>> Currently tests that are launched with TestCommon.runWithArchive() and CDSTestUtils.runWithArchive() can handle -Dtest.cds.runtime.options. However, some test cases, such as dynamicArchive/HelloDynamic.java, do not call the above two methods, so they ignore -Dtest.cds.runtime.options.
>>
>> The fix is to move the handling of -Dtest.cds.runtime.options to TestCommon.executeAndLog, because most CDS tests use this function to launch a child JVM. Other considerations are necessary now that the option is exposed to other tests, so checks for GC and CDS are necessary. Verified with tier1-4 tests.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed indentation and removed unused imports
A couple of nits but otherwise codewise this seem okay.
Semantically I still think there is a conflict between a test specifying a GC and also using `test.cds.runtime.options` that sets a GC.
test/lib/jdk/test/lib/cds/CDSTestUtils.java line 624:
> 622:
> 623: public static boolean isGCOption(String s) {
> 624: return s.startsWith("-XX:+Use") && s.endsWith("GC");
Nit: maybe `s.matches` with a suitable regex would be more effecient?
test/lib/jdk/test/lib/cds/CDSTestUtils.java line 639:
> 637: // The test.cds.runtime.options property is used to inject extra VM options to
> 638: // subprocesses launched by the CDS test cases using executeAndLog().
> 639: // The injection applies only to subprocess that:
nit: s/subprocess/subprocesses/
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13273#pullrequestreview-1372021832
PR Review Comment: https://git.openjdk.org/jdk/pull/13273#discussion_r1157929798
PR Review Comment: https://git.openjdk.org/jdk/pull/13273#discussion_r1157930071
More information about the hotspot-runtime-dev
mailing list