RFR: 8350786: Some java/lang jtreg tests miss requires vm.hasJFR
Alan Bateman
alanb at openjdk.org
Thu Feb 27 08:52:02 UTC 2025
On Thu, 27 Feb 2025 08:43:32 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
>> test/jdk/java/lang/Thread/ThreadSleepEvent.java line 28:
>>
>>> 26: * @summary Test that Thread.sleep emits a JFR jdk.ThreadSleep event
>>> 27: * @requires vm.hasJFR
>>> 28: * @modules jdk.jfr
>>
>> These tests already have `@modules jdk.jfr` so the tests won't be selected by jtreg to execute when the JDK under test doesn't have this module. I realize `vm.hasJFR` is whether the VM has been built with JFR included but it seems a bit strange to have a JDK containing `jdk.jfr` but not supporting JFR. So I'm curious what is being tested. Is this a run-time image that contains more than one VM, maybe everything in the "server VM" and also the minimal VM?
>
> A minimal JVM (**--with-jvm-features=minimal --with-jvm-variants=minimal**) is tested. This contains no JFR in Hotspot.
> If you configure the build without JVM feature JFR (like minimal) , the tests need the correct requires tags; most tests have this but some not.
If the only VM to be built is the minimal VM then maybe it should filter down the set of modules to include. Just saying that it's a bit strange to include the `jdk.jfr` module but not support JFR, if you see what I mean.
BTW: I don't object to the change, it's just means that any test using the JFR APIs has to say so twice.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23805#discussion_r1973140230
More information about the core-libs-dev
mailing list