-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8349192: jvmti/scenarios/contention/TC05/tc05t001 fails: ERROR: tc05t001.cpp, 281: (waitedThreadCpuTime - waitThreadCpuTime) < (EXPECTED_ACCURACY * 1000000) #28206
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,9 +40,9 @@ static const jlong EXPECTED_TIMEOUT = 1; | |
| static const jlong EXPECTED_TIMEOUT_ACCURACY_NS = 300000; | ||
|
|
||
| #if (defined(WIN32) || defined(_WIN32)) | ||
| static const jlong EXPECTED_ACCURACY = 16; // 16ms is longest clock update interval | ||
| static const jlong EXPECTED_ACCURACY = 32; // 16ms is longest clock update interval | ||
| #else | ||
| static const jlong EXPECTED_ACCURACY = 10; // high frequency clock updates expected | ||
| static const jlong EXPECTED_ACCURACY = 32; // high frequency clock updates expected | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comments are somewhat misleading now. We choose 16 on WIN32 because that is the smallest interval allowed. We expect better clock refinement on other platforms and therefore better accuracy. Thus 10ms was chosen. Now we have one test case that was just over 16ms. Is there a reason to believe that couldn't happen with WIN32 also. If not, then the comments should reflect that.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel that all these checks are just a source of this test instability. :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong. The "expected" accuracy is still 10ms or even 1ms, it is never 32ms. The test may need to wait longer but changing this value makes no sense.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the real issue is that EXPECTED_ACCURACY is incorrectly named. It is being used as a max amount of elapsed time, not as an "accuracy" value. The comment on the WIN32 part just adds to the confusion. The "max elapsed time" has to be 16 ms because that is the clock is only accurate to 16ms, so even 1ms of elapsed times will show up as 16ms. The comment "16ms is longest clock update interval" should read "shortest", not "longest". EXPECTED_TIMEOUT_ACCURACY_NS also seems to be misnamed.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you, Chris. My intention was to fix this intermittent failure and achieve better stability. My preference would be to get rid of these troublesome and useless checks instead of fixing confusing constant names and comments.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No it is the longest interval between clock updates (actually 15.259) based on the old PIT timer (1/65536). Modern hardware will have 10ms or even 1ms. The code expects to see at most one timer-tick of elapsed time, hence the name and the value. |
||
| #endif | ||
|
|
||
| /* scaffold objects */ | ||
|
|
||
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.
Does the comment 16ms should be updated.
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.
Thank you for the comment. I've decided to restore the original
EXPECTED_ACCURACYon Windows.