RFR: 8320750: Allow a testcase to run with muliple -Xlog

Daniel D. Daugherty dcubed at openjdk.org
Mon Jan 8 14:41:30 UTC 2024


On Mon, 8 Jan 2024 13:01:30 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> Running a testcase with muliple -Xlog crashes JTREG test cases. This is because `Collector.toMap` is not given a merge strategy.
>> 
>> When the same argument is passed multiple times, I have added a merge strategy to use the latter value. This is similar to how it is implemented for `vm.opt.*` in JTREG.
>> 
>> If the flag tested is `-Xlog`, replace the value part with a dummy value "NONEMPTY_TEST_SENTINEL". This is because in the case of multiple `-Xlog` all values are used, and JTREG does not give a satisfactory way to represent them. This dummy value should make it hard to try to `@require` on specific values by mistake.
>> 
>> Tested with:
>> 
>>  @requires vm.opt.x.Xlog == "NONEMPTY_TEST_SENTINEL"
>>  @requires vm.opt.x.Xlog == "NONEMPTY_TEST_SENTINELXXX"
>>  @requires vm.opt.x.Xms == "3g"
>> 
>> and
>> 
>> JAVA_OPTIONS=-Xms3g -Xms4g
>> JAVA_OPTIONS=-Xms4g -Xms3g
>> JAVA_OPTIONS=-Xlog:gc* -Xlog:gc*
>> ``` 
>> 
>> Running tier1
>
> Hi again, I would like to resolve this issue in some way, as I am responsible for introducing this problem. I think the proposed fix is alright and gives us a way to `@require` test against non `-XX` flags. If you strongly feel that the feature to test against flags that are not supported by JTREG is unnecessary, I will remove the feature.

@lkorinth - I fixed the typo in the bug's synopsis. You'll need to adjust the PR's title.
The easiest way is to use "/issue JDK-8320750".

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

PR Comment: https://git.openjdk.org/jdk/pull/16824#issuecomment-1881135144


More information about the hotspot-dev mailing list