RFR: 8302117: IgnoreUnrecognizedVMOptions flag causes failure in ArchiveHeapTestClass

Ioi Lam iklam at openjdk.org
Sat Feb 11 04:57:33 UTC 2023


On Thu, 9 Feb 2023 08:32:48 GMT, Ramkumar Sunderbabu <rsunderbabu at openjdk.org> wrote:

>> test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchiveHeapTestClass.java line 178:
>> 
>>> 176:         output = dumpHelloOnly("-XX:-IgnoreUnrecognizedVMOptions", "-XX:ArchiveHeapTestClass=NoSuchClass");
>>> 177:         mustFail(output, "VM option 'ArchiveHeapTestClass' is develop and is available only in debug version of VM.");
>>> 178:     }
>> 
>> This is a very odd way to test this. The usual thing would be to mark the test as needing vm.debug and not even caring about what happens in a product build. This isn't actually testing the flag it is testing whether declaring a flag as develop works - which isn't what this test is really supposed to be for (that would be a VMFlags test). But this change will fix it. Though I'm not sure where the `-XX:+ignoreUnrecognizedVMOptions` is coming from.
>
> -XX:+IgnoreUnrecognizedVMOptions can come from -vmoptions in jtreg command.

The `-XX:ArchiveHeapTestClass` flag is for testing purposes only. It allows arbitrary Java heap objects to be archived. We use this flag to test CDS internals.

However, archiving arbitrary Java heap objects is not a supported feature. This test case makes sure that we don't enable this flag by mistake in the product build.

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

PR: https://git.openjdk.org/jdk/pull/12483


More information about the hotspot-runtime-dev mailing list