tests: deflake TestWatchFailed#10943
Conversation
|
Warning Review limit reached
More reviews will be available in 1 minute and 37 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesTSO keyspace-group readiness test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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 |
6c8a3dd to
4550084
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@tests/integrations/mcs/tso/keyspace_group_manager_test.go`:
- Around line 191-194: The stale-revision assertion path in
findGroupByKeyspaceID handling can panic because it dereferences resp before
confirming the RPC succeeded. Update the error branch to guard both err and resp
before accessing resp.GetHeader().GetError(), and assert the transport error
separately from the expected header error so the test handles transient RPC
failures without crashing.
- Around line 150-165: The RPC helper in findGroupByKeyspaceID is using
suite.ctx directly, which leaves each FindGroupByKeyspaceID call unbounded
during polling. Update this helper to create a per-call context with timeout (or
deadline) before invoking tsopb.NewTSOClient(conn).FindGroupByKeyspaceID, and
ensure the cancel function is deferred so each retry attempt is independently
bounded. Keep the change localized to findGroupByKeyspaceID and preserve the
existing request construction and service-discovery connection logic.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 96f8c504-8e12-4522-8f3f-619feae492de
📒 Files selected for processing (1)
tests/integrations/mcs/tso/keyspace_group_manager_test.go
Signed-off-by: Ryan Leung <rleungx@gmail.com>
4550084 to
40235e4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10943 +/- ##
==========================================
- Coverage 79.26% 79.18% -0.09%
==========================================
Files 540 541 +1
Lines 74954 75035 +81
==========================================
+ Hits 59412 59414 +2
- Misses 11371 11425 +54
- Partials 4171 4196 +25
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/retest |
2 similar comments
|
/retest |
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bufferflies, lhy1024 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:
|
|
/retest |
1 similar comment
|
/retest |
What problem does this PR solve?
Issue Number: Close #10627
TestTSOKeyspaceGroupManagerSuite/TestWatchFailedis flaky. The test waits until a keyspace group has a serving primary, but then directly queries specific TSO node addresses. A queried TSO node may not have loaded the updated keyspace group metadata yet, soFindGroupByKeyspaceIDcan still return the default keyspace group.What is changed and how does it work?
Check List
Tests
make -C tests/integrations gotest GOTEST_ARGS='-tags without_dashboard ./mcs/tso -run TestTSOKeyspaceGroupManagerSuite/TestWatchFailed -count=1'Code changes
Side effects
Related changes
Release note
Summary by CodeRabbit