junit5 icon indicating copy to clipboard operation
junit5 copied to clipboard

Introduce low-level JFR events

Open leonard84 opened this issue 1 year ago • 10 comments

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

  • [ ] Move JFR events into the platform core
  • [ ] Add additional low-level events, e.g., for resource locks

leonard84 avatar Mar 15 '24 12:03 leonard84

TODO: Double-check if OpenJ9 also supports JFR

marcphilipp avatar Mar 22 '24 11:03 marcphilipp

Not yet, it seems:

  • https://github.com/eclipse-openj9/openj9/issues/4655

sormuras avatar Mar 22 '24 12:03 sormuras

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.

leonard84 avatar Apr 09 '24 14:04 leonard84

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

marcphilipp avatar Apr 12 '24 07:04 marcphilipp

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

marcphilipp avatar Apr 12 '24 19:04 marcphilipp

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.

sormuras avatar Jun 10 '24 13:06 sormuras

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

leonard84 avatar Aug 29 '24 11:08 leonard84