ttl: stabilize TestCancelWhileScan runtime#67657
Conversation
|
@zanmato1984 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 @zanmato1984. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTest TestCancelWhileScan changes single-row INSERTs to batched multi-row INSERTs: introduces ChangesTTL Scan Integration Test
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
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 |
zanmato1984
left a comment
There was a problem hiding this comment.
Role: Reviewer-R1
LGTM (round 1).
Checks:
- Original test intent is preserved: TestCancelWhileScan still asserts cancellation completes within 1s after cancel().
- Change scope is test-only and minimal: only pkg/ttl/ttlworker/scan_integration_test.go is updated.
- Recurrence analysis is consistent with evidence from the reopened flaky issue/build logs: current recurrence is timeout/runtime pressure rather than statement-boundary correctness.
- No unnecessary timing-only precise repro is retained: this update simplifies the stress profile and keeps deterministic cancellation coverage without extra reproducer-only paths.
Validation:
- ./tools/check/failpoint-go-test.sh pkg/ttl/ttlworker -run '^TestCancelWhileScan$' -count=20 (pass)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #67657 +/- ##
================================================
- Coverage 77.5871% 76.2559% -1.3313%
================================================
Files 1981 1995 +14
Lines 547950 576477 +28527
================================================
+ Hits 425139 439598 +14459
- Misses 122001 135372 +13371
- Partials 810 1507 +697
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| testStart := time.Now() | ||
| testDuration := time.Second | ||
| rounds := 10 | ||
| if testflag.Long() { |
There was a problem hiding this comment.
Long mode doesn't affect the CI, so I don't think this change will be helpful.
There was a problem hiding this comment.
Good point. I removed the testflag.Long() branch so CI and local runs now execute the same loop count (rounds := 10), while keeping the original cancellation assertion and test intent unchanged.
Validation:
./tools/check/failpoint-go-test.sh pkg/ttl/ttlworker -run "^TestCancelWhileScan$" -count=1(pass)make lint(pass)
Included in commit 10aeb41daf.
|
/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. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/ttl/ttlworker/scan_integration_test.go`:
- Line 44: There's a typo: the identifier "tesflag" used in the condition
calling tesflag.Long() should be the imported package "testflag"; replace the
incorrect "tesflag" with "testflag" so the condition reads testflag.Long(),
matching the import and the other usage (e.g., the call at line using
testflag.Long()) to fix the compile error.
🪄 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: b64994b8-a92e-4c17-bd12-e562470fc6e0
📒 Files selected for processing (1)
pkg/ttl/ttlworker/scan_integration_test.go
Signed-off-by: Yang Keao <yangkeao@chunibyo.icu>
f140c74 to
b6bfd3e
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, YangKeao 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 |
|
@zanmato1984: The following tests 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: ref #66982
Problem Summary:
TestCancelWhileScanstill times out in CI under resource pressure. The previous fix in #67285 addressed statement-boundary cancellation correctness, but this test still spent too much time in long-mode stress setup/execution and could exceed shard timeout.What changed and how does it work?
This PR keeps the same cancellation assertions and makes the stress path cheaper and more deterministic:
TestCancelWhileScaninstead of issuing 10k single-row inserts.10default,30in-long) instead of time-based loops.sleepCoprRequest=200ms) so each round still exercises cancellation while avoiding heavy table size/time requirements.This keeps the regression coverage focused on cancellation responsiveness while removing the long-tail runtime behavior that caused timeouts.
Check List
Tests
Side effects
Documentation
Release note
Summary by CodeRabbit