-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
gogctuner: fix unstable test in the TestTuner #39101
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
333d2c4
to
2479f1b
Compare
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.
Now the default min value of GOGC is 100 for gogc tuner
Why we do this? I'm afraid it will increase the possibility of OOM.
util/gctuner/tuner_test.go
Outdated
require.GreaterOrEqual(t, tn.getGCPercent(), uint32(50)) | ||
require.LessOrEqual(t, tn.getGCPercent(), uint32(100)) | ||
require.GreaterOrEqual(t, tn.getGCPercent(), MinGCPercent) | ||
require.LessOrEqual(t, tn.getGCPercent(), uint32(200)) |
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.
This should not change? the active heap can be equal or larger than threshold/2, so we should expect the percentage equal or less than 100%.
Also, this test have repeated many hardcode values.
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.
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.
the origin threshold is so small for the test case to be disturbed by the memory of the test framework.
At the earliest, the default value of gogctuner is less than 100. the main reason is the global memory limiter needs to use GOGC to judge the time of forcely garbage collection. so we need to change our strategy. GOGC tuner now has a max memory threshold. if memory is over it, gogc tuner will stop working. this threshold is always less than the threshold of global memory limiter. So that it can avoid the OOM |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7051f35
|
TiDB MergeCI notify🔴 Bad News! New failing [2] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #38467
Problem Summary:
What is changed and how it works?
Now the default min value of GOGC is 100 for gogc tuner. so This range in test is too small to run.
the origin threshold is so small for the test case to be disturbed by the memory of the test framework.
Check List
Tests
Run the test 100 times
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.