-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8351002: com/sun/management/OperatingSystemMXBean cpuLoad tests fail intermittently #24186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8351002: com/sun/management/OperatingSystemMXBean cpuLoad tests fail intermittently #24186
Conversation
|
👋 Welcome back kevinw! A progress list of the required criteria for merging this PR into |
|
@kevinjwalls This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 42 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@kevinjwalls The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
test/jdk/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
Show resolved
Hide resolved
test/jdk/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
Outdated
Show resolved
Hide resolved
test/jdk/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
Outdated
Show resolved
Hide resolved
test/jdk/com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java
Outdated
Show resolved
Hide resolved
test/jdk/com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java
Outdated
Show resolved
Hide resolved
test/jdk/com/sun/management/OperatingSystemMXBean/GetProcessCpuTime.java
Outdated
Show resolved
Hide resolved
lmesnik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally, changes looks good for me. Please address @plummercj comments.
|
The only one generic question: doesn't it makes sense to update JMX to retry several times if Windows 2029 returns -1.0 or undefined to make JDK more reliable? |
Yes, I was bit worried about adding the overhead of repeating the call, maybe 5 times, with short sleeps, in the MBean CPU monitoring code. It's been this way "forever", and is documented to return a negative value when info is "not available", so it is still delivering what it promises. |
|
That's fine then. |
sspitsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is a little bit hacky but as a work around should be okay.
LGTM
|
Thanks for all the reviews and comments. The timing check in GetSystemCpuLoad.java is a little hacky. That test has never claimed to try and test that the cpu time is "correct", but now it will at least test the time measured is not crazy. If I got the definition of "crazy" wrong, will be back here... |
|
/integrate |
|
Going to push as commit eb6e828.
Your commit was automatically rebased without conflicts. |
|
@kevinjwalls Pushed as commit eb6e828. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
These tests have always silently permitted a -1 return value from OperatingSystemMXBean CPU time methods.
They need to be stricter, but occasionally Windows 2019 returns a -1 for the first few calls of these methods. This seems to be a Windows 2019 bug or peculiarity. Other Windows versions are not affected.
GetProcessCpuLoad.java and GetSystemCpuLoad.java need to fail only if the CPU time calls continually return -1. They should permit -1 values, as long as subsequently a value in the valid range is read.
The GetProcessCpuTime test also needs to retry enough times to expect no -1 values, and not just skip. While updating this test: it has a maximum expected value of Long.MAX_VALUE, which it may as well reduce to something that does not look like a binary "all ones except for the high bit" value (without creating an ongoing game where we keep increasing the value to avoid failures in slow runs).
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24186/head:pull/24186$ git checkout pull/24186Update a local copy of the PR:
$ git checkout pull/24186$ git pull https://git.openjdk.org/jdk.git pull/24186/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24186View PR using the GUI difftool:
$ git pr show -t 24186Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24186.diff
Using Webrev
Link to Webrev Comment