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
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
- relates to
-
JDK-8317228 GC: Make TestXXXHeapSizeFlags use createTestJvm
- Resolved
-
JDK-8325763 Revert properties: vm.opt.x.*
- Resolved
- links to
-
Review openjdk/jdk/16824