RFR: 8318098: Update jfr tests with corresponding requires flags [v2]
Leonid Mesnik
lmesnik at openjdk.org
Tue Nov 19 19:11:46 UTC 2024
On Tue, 19 Nov 2024 18:51:46 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:
> Why not put vm.flagless on everything then?
>
Although it makes the test compliant, it significantly reduce coverage. I provide examples of the issues that were already found.
The issue
https://bugs.openjdk.org/browse/JDK-8344199
Incorrect excluded field value set by getEventWriter intrinsic
is observed only when we run tests with Xcomp.
Otherwise neither of JFR code is compiled and the C2-path is not executed.
Unfortunately, there are no tests for this and the easiest way to test is just to run all existing tests with forced C2.
> Else we find ourselves in situations like the following:
>
> TestPromotionEventWithG1.java @requires vm.compMode != "Xcomp"
>
> Why is vm.compMode now all of a sudden a requirement for this test? How was it determined that Xcomp should be excluded for this test that tests a PromotionEvent for G1?
The requirement for JDK tests is to reject incompatible options used during testing.
I excluded the test TestPromotionEventWithG1 because it failing with Xcomp.
Looking on the test that configure
* @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:+UseG1GC -XX:-UseStringDeduplication -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
* @run main/othervm -Xmx32m -Xms32m -Xmn12m -XX:AllocatePrefetchLines=1 -XX:AllocateInstancePrefetchLines=1 -XX:AllocatePrefetchStepSize=16 -XX:AllocatePrefetchDistance=1 -XX:+UseG1GC
* -XX:-UseStringDeduplication -Xlog:os+cpu=info -XX:MaxTenuringThreshold=5 -XX:InitialTenuringThreshold=5 -XX:MinTLABSize=768 -XX:TLABSize=768 jdk.jfr.event.gc.detailed.TestPromotionEventWithG1
it is clear that test might be too specific to use any additional VM flags. Such tests are indeed good candidate to be marked as a flagless from the beginning.
You might just use 'vm.flagless' for unit tests, however for tests that don't need very specific setup it is better to allow to run different combinations. It helps to better test how JFR is not broken in different modes. No need to test all those thing before push, unless you have a reasons to believe that test is specific to some modes.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22249#issuecomment-2486530617
More information about the hotspot-compiler-dev
mailing list