RFR: 8350786: Some java/lang jtreg tests miss requires vm.hasJFR
Matthias Baesken
mbaesken at openjdk.org
Thu Feb 27 08:45:52 UTC 2025
On Thu, 27 Feb 2025 08:36:58 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> While testing a bit with a minimal JVM, it has been noticed that some java/lang jtreg tests use jfr but do not declare it with a "requires vm.hasJFR" ; that leads to test errors in a JVM setup with no JFR .
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23805#discussion_r1973130489
More information about the core-libs-dev
mailing list