RFR: JDK-8220813: update hotspot tier1_gc tests depending on GC to use @requires vm.gc.X
Leonid Mesnik
leonid.mesnik at oracle.com
Tue Mar 19 20:02:02 UTC 2019
Hi
Using 'requires vm.gc.XXX' is correct way to select supported GC. However I think your fix is incomplete. Your fix skips tests if any of tested GC is not supported. I think that it would be better to test supported configurations rather then skip whole test.
Let see test
http://cr.openjdk.java.net/~aoqi/8220813/webrev.00/test/hotspot/jtreg/gc/TestAgeOutput.java.udiff.html <http://cr.openjdk.java.net/~aoqi/8220813/webrev.00/test/hotspot/jtreg/gc/TestAgeOutput.java.udiff.html>
If G1 is not build then whole test is skipped. So it makes sense to split following test
26 /*
27 * @test TestAgeOutput
28 * @bug 8164936
29 * @summary Check that collectors using age table based aging print an age table even for the first garbage collection
30 * @key gc
31 * @requires vm.gc.Serial & vm.gc.G1
32 * @modules java.base/jdk.internal.misc
33 * @library /test/lib
34 * @build sun.hotspot.WhiteBox
35 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
36 * @run main/othervm -XX:+UseSerialGC gc.TestAgeOutput UseSerialGC
37 * @run main/othervm -XX:+UseG1GC gc.TestAgeOutput UseG1GC
38 */
39
into 2 tests to cover Serial/G1 GC separately.
/*
* @test TestAgeOutput
* @bug 8164936
* @summary Check that collectors using age table based aging print an age table even for the first garbage collection
* @key gc
* @requires vm.gc.Serial
...
* @run main/othervm -XX:+UseSerialGC gc.TestAgeOutput UseSerialGC
...
/*
* @test TestAgeOutput
* @bug 8164936
* @summary Check that collectors using age table based aging print an age table even for the first garbage collection
* @key gc
* @requires vm.gc.G1
...
* @run main/othervm -XX:+UseG1GC gc.TestAgeOutput UseG1GC
...
The same for tests which execute VM with different arguments and don't use external arguments. Test
http://cr.openjdk.java.net/~aoqi/8220813/webrev.00/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java.html <http://cr.openjdk.java.net/~aoqi/8220813/webrev.00/test/hotspot/jtreg/gc/arguments/TestParallelRefProc.java.html>
is not going to be executed if any of GC is not supported.
The another question is that before fix it was enough to run tests with default GC and all supported GC to get full coverage without significant duplication. But now it seems that a lot of tests will be executed twice.
Might be after complete fix it would be enough to run tests with selected GC only? Could you please provide some summary of test coverage/duplication after your fix.
Leonid
> On Mar 19, 2019, at 2:48 AM, Ao Qi <aoqi at loongson.cn> wrote:
>
> Hi,
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8220813
> Webrev: http://cr.openjdk.java.net/~aoqi/8220813/webrev.00/
>
> If a particular GC is not supported, some hotspot tier1_gc tests
> fails. The patch allows tests to be skipped on platforms where a GC is
> not supported.
>
> Tested:
>
> before (configure using --with-jvm-features):
> configure TOTAL PASS FAIL ERROR
> default 251 251 0 0
> -cmsgc 243 222 21 0
> -epsilongc 229 229 0 0
> -g1gc,-jfr 181 157 24 0
> -parallelgc 241 219 22 0
> -shenandoahgc 206 206 0 0
> -zgc 251 251 0 0
>
> after (configure using --with-jvm-features):
> configure TOTAL PASS FAIL ERROR
> default 251 251 0 0
> -cmsgc 222 222 0 0
> -epsilongc 229 229 0 0
> -g1gc,-jfr 157 157 0 0
> -parallelgc 219 219 0 0
> -shenandoahgc 206 206 0 0
> -zgc 251 251 0 0
>
> before:
> VM_OPTIONS TOTAL PASS FAIL ERROR
> default 251 251 0 0
> -XX:+UseG1GC 129 129 0 0
> -XX:+UseSerialGC 65 65 0 0
> -XX:+UseParallelGC 69 69 0 0
> -XX:+UseConcMarkSweepGC 67 67 0 0
>
> after:
> VM_OPTIONS TOTAL PASS FAIL ERROR
> default 251 251 0 0
> -XX:+UseG1GC 121 121 0 0
> -XX:+UseSerialGC 51 51 0 0
> -XX:+UseParallelGC 60 60 0 0
> -XX:+UseConcMarkSweepGC 66 66 0 0
>
> The difference in VM_OPTIONS tests mainly comes from two reasons:
> 1. This patch make this kind of change:
>
> @requires vm.gc=="null" & !vm.graal.enabled
> =>
> @requires vm.gc.ConcMarkSweep & !vm.graal.enabled
>
> Take gc/arguments/TestAlignmentToUseLargePages.java#id1 for example.
> Before the patch, even if VM_OPTIONS=-XX:+UseConcMarkSweepGC is set,
> gc/arguments/TestAlignmentToUseLargePages.java#id1 will not be
> executed (but the test is intended to test -XX:+UseConcMarkSweepGC).
> After the patch, the test will be executed if
> VM_OPTIONS=-XX:+UseConcMarkSweepGC is set.
>
> 2. If a test use a particular GC in the code (not in the jtreg tag
> fields) and another GC is passed by -XX:UseXGC, the test will be
> skipped.
> For example, gc/startup_warnings/TestG1.java uses -XX:+UseG1GC in the
> main method. This test will be skipped, when
> VM_OPTIONS=-XX:+UseConcMarkSweepGC is used. Before this patch, it will
> be executed.
>
> I am doing more tests and checking test results above. Could someone
> give some advice on this change?
>
> Thanks,
> Ao Qi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-gc-dev/attachments/20190319/415326c0/attachment.htm>
More information about the hotspot-gc-dev
mailing list