junit-team / junit5

✅ The 5th major version of the programmer-friendly testing framework for Java and the JVM
https://junit.org
Other
6.35k stars 1.48k forks source link

Introduce low-level JFR events #3728

Open leonard84 opened 6 months ago

leonard84 commented 6 months ago

Motivation

Currently, junit-platform-jfr provides events that are observable to standard listeners.

However, it can't provide insights into low-level events, such as the exclusive resource locks.

Previously, it was decided to only introduce JFR via an optional module because it was not supported until JDK 11. A lot has changed since: JFR has been backported to openjdk8, and all current distributions support it. Plus, JDK 9 and 10 have been EOL for a long time.

Furthermore, there is the https://github.com/gradle/jfr-polyfill project that provides a no-op implementation that prevents any crashes due to ClassNotFoundError.

Deliverables

marcphilipp commented 6 months ago

TODO: Double-check if OpenJ9 also supports JFR

sormuras commented 6 months ago

Not yet, it seems:

leonard84 commented 5 months ago

OpenJ9 should work with jfr-polyfill. The question is whether you'd want to add it as a default dependency, or if OpenJ9 users should add it themselves.

marcphilipp commented 5 months ago

As a first step, we should add a CI build using OpenJ9 to run tests. I'll see to that.

marcphilipp commented 5 months ago

As a first step, we should add a CI build using OpenJ9 to run tests. I'll see to that.

Done in https://github.com/junit-team/junit5/pull/3768

sormuras commented 3 months ago

Moving the JFR events from the extra module to core would also render the extra configuration step to include junit-platform-jfr-$VERSION.jar described in https://junit.org/junit5/docs/current/user-guide/#running-tests-listeners-flight-recorder superseded. Which in turn enables users of the junit-platform-console-standalone-$VERSION.jar variant also make use of JFR events by default.

leonard84 commented 1 month ago

This would've helped to evaluate #3936, and the recent deadlocks in Spock's CI builds.