RFR: 8341261: Tests assume UnlockExperimentalVMOptions is disabled by default
Stefan Karlsson
stefank at openjdk.org
Tue Oct 1 19:30:36 UTC 2024
On Fri, 27 Sep 2024 20:12:59 GMT, Todd V. Jonker <duke at openjdk.org> wrote:
> 'm not entirely satisfied by adding a @require that only applies to a subset of the checks in a test class. In VMOptionWarning, the experimental flag only applies to the first of the three scenarios it checks. But I suspect this is a general problem with @require, and I'd be happy to hear suggestions on how to avoid disabling too much.
You can add multiple run sections with different @requires lines. Then you can let each run line pass in different "tokens" to the main function and let it use that to dispatch to the various sub-tests. Maybe `test/hotspot/jtreg/gc//metaspace/TestSizeTransitions.java` could be a an OK inspiration for that.
test/jtreg-ext/requires/VMProps.java line 262:
> 260: return "" + WB.getBooleanVMFlag("UnlockExperimentalVMOptions");
> 261: }
> 262:
I think an alternative here could be to just add UnlockExperimentalVMOptions to the list in vmOptFinalFlags and then use `!vm.opt.final.UnlockExperimentalVMOptions`. This is what we typically do when we want to filter on the final value of a specified flag.
-------------
PR Review: https://git.openjdk.org/jdk/pull/21233#pullrequestreview-2341198738
PR Review Comment: https://git.openjdk.org/jdk/pull/21233#discussion_r1783371562
More information about the hotspot-dev
mailing list