Repository navigation
pkg/executor/test/unstabletest: stabilize flaky TestPBMemoryLeak - #67880
Conversation
|
@flaky-claw I've received your pull request and will start the review. I'll conduct a thorough review covering code quality, potential issues, and implementation details. ⏳ This process typically takes 10-30 minutes depending on the complexity of the changes. ℹ️ Learn more details on Pantheon AI. |
|
Hi @flaky-claw. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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. |
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded ChangesUnstable test refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/executor/test/unstabletest/memory_test.go`:
- Around line 142-144: The test currently uses memDiff (absolute) which fails
when HeapInuse drops; instead compute positive growth only by taking growth :=
int64(inUseAfterSecondScan.HeapInuse) - int64(inUseAfterWarmup.HeapInuse), clamp
growth to zero if negative (if growth < 0 { growth = 0 }), and then assert
require.Less(t, growth, delta) (or equivalent) so only continued upward heap
growth beyond delta fails; update the assertion replacing memDiff(...) with this
positive-growth check referring to readMem, inUseAfterSecondScan,
inUseAfterWarmup, and HeapInuse.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6c2808e7-db37-41f7-92d1-02e685a10f15
📒 Files selected for processing (2)
pkg/executor/test/unstabletest/BUILD.bazelpkg/executor/test/unstabletest/memory_test.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #67880 +/- ##
================================================
- Coverage 77.7307% 77.0163% -0.7144%
================================================
Files 1990 1973 -17
Lines 551899 552971 +1072
================================================
- Hits 428995 425878 -3117
- Misses 121984 127064 +5080
+ Partials 920 29 -891
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/check-issue-triage-complete |
|
FlakyFixer PR update summary Fix
Verification Spec:
Observed result:
Gate checklist:
Commands:
|
|
/retest |
|
@yinsustart: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Defined2014, hawkingrei The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
@flaky-claw: 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. |
cee391e to
c09443f
Compare
What problem does this PR solve?
Issue Number: close #67422
Problem Summary:
Flaky test
TestPBMemoryLeakinpkg/executor/test/unstabletestintermittently fails, so this PR stabilizes that path.What changed and how does it work?
Root Cause
TEST_ISSUE; TestPBMemoryLeak treated first-scan warm-up allocations and retained heap noise as a leak signal, making the original HeapInuse assertion sensitive to one-time setup effects rather than repeated-scan growth.
Fix
Reworked the test to treat the first scan as warm-up, close result sets, and assert that HeapInuse does not keep growing on a second scan; also enabled intest assertions per test with cleanup and added the Bazel dep for the new import.
Verification
Spec:
pkg/executor/test/unstabletest :: TestPBMemoryLeaktidb.go_flaky.defaultBASELINE_ONLYObserved result:
Required flaky case was not skipped.
Required flaky gate passed.
Affected scope regression gate passed.
Build safety gate passed.
Intent guard gate passed.
Gate checklist:
Commands:
go test -json ./pkg/executor/test/unstabletest -run '^TestPBMemoryLeak$' -count=1go test -json ./pkg/executor/test/unstabletest -count=1make buildCheck List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Fixes #67422
Summary by CodeRabbit