Skip to content

8365498: jdk/jfr/event/os/TestCPULoad.java fails with Expected at least one event#30636

Open
egahlin wants to merge 1 commit intoopenjdk:masterfrom
egahlin:reliable-test-cpu-load
Open

8365498: jdk/jfr/event/os/TestCPULoad.java fails with Expected at least one event#30636
egahlin wants to merge 1 commit intoopenjdk:masterfrom
egahlin:reliable-test-cpu-load

Conversation

@egahlin
Copy link
Copy Markdown
Member

@egahlin egahlin commented Apr 8, 2026

Could I have a review of a test fix that tries to make TestCPULoad more reliable?

Previously, the event was emitted with "everyChunk", which means JFR makes a request at the beginning and end of each chunk. Two samples are usually sufficient to calculate the delta. On Windows, we’ve had a long-standing problem with perf. counters that can result in a sample not being taken, in which case we just return.

On macOS, the test has been failing intermittently for some time. We’ve tried various fixes to make it more reliable, but without much improvement. I could apply a similar fix as on Windows, but the risk is that we might miss a situation where no event is emitted at all due to a product bug.

Instead, I decided to use EventStream and wait until we receive a sample. If it fails now, we’ll at least know that in some situations the mechanism isn’t working at all.

Testing: 600 * jdk/jfr/event/os/TestCPULoad.java on Windows, Linux and macOS.

Thanks
Erik


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8365498: jdk/jfr/event/os/TestCPULoad.java fails with Expected at least one event (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30636/head:pull/30636
$ git checkout pull/30636

Update a local copy of the PR:
$ git checkout pull/30636
$ git pull https://git.openjdk.org/jdk.git pull/30636/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30636

View PR using the GUI difftool:
$ git pr show -t 30636

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30636.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 8, 2026

👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 8, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the hotspot-jfr hotspot-jfr-dev@openjdk.org label Apr 8, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 8, 2026

@egahlin The following label will be automatically applied to this pull request:

  • hotspot-jfr

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@egahlin egahlin marked this pull request as ready for review April 8, 2026 22:00
@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 8, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 8, 2026

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-jfr hotspot-jfr-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant