-
Notifications
You must be signed in to change notification settings - Fork 753
call runtime.GC to reduce flaky #10230
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: lance6716 <lance6716@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThis PR adds a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ❌ 5❌ Failed checks (1 warning, 4 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 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.
Pull request overview
This PR aims to reduce flakiness in the gctuner memory limit tuner tests by explicitly triggering Go GC rather than relying on nondeterministic runtime GC timing.
Changes:
- Add an explicit
runtime.GC()call inside arequire.Eventuallyloop inTestGlobalMemoryTunerto make the test less timing-dependent.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| require.Eventually(t, func() bool { | ||
| runtime.GC() |
Copilot
AI
Feb 9, 2026
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.
Calling runtime.GC() on every require.Eventually poll can trigger up to ~50 full GCs (5s / 100ms), which can noticeably slow CI and add noise to this test. Consider invoking GC at most once (e.g., before entering the Eventually) or gating it so it only runs once after the tuner indicates the next GC would be memory-limit related (e.g., after nextGCTriggeredByMemoryLimit becomes true).
| require.Eventually(t, func() bool { | |
| runtime.GC() | |
| runtime.GC() | |
| require.Eventually(t, func() bool { |
|
@lance6716: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: close #10229
What is changed and how does it work?
call runtime.GC, no need to wait the indeterministic GC behaviour
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs/pingcap/docs-cn:pingcap/tiup:Release note
Summary by CodeRabbit