Conversation
|
[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 |
📝 WalkthroughWalkthroughReplace the explicit probe SendReq in TestClusterIDInReq with an Eventually readiness loop that retries SendRequest until the server loop is ready; change the ClusterId assertion to a greater-than-0 check and perform the final SendReq with a 1s timeout after readiness is observed. Changes
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)
No actionable comments were generated in the recent review. 🎉 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.
Pull request overview
This PR stabilizes the TestClusterIDInReq test by removing its dependency on a real mock gRPC server and network timing. The test now uses a simple inline function stub to validate request metadata, making it deterministic and eliminating CI flakiness.
Changes:
- Replaced mock gRPC server setup with an inline fnClient stub
- Removed probe request and cleanup code that was causing timing-related flakiness
- Changed timeout from 10ms to 1 second since timeout behavior is no longer being tested
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: lance6716 <lance6716@gmail.com>
Signed-off-by: lance6716 <lance6716@gmail.com>
8729986 to
b8bcdaf
Compare
close #1893
What
TestClusterIDInReqonMockTikvService(no test simplification to pure stub)ClusterId > 0in the wrappedfnClientSendReq+ 10ms timeout) with:rpcClient.SendRequest+Eventuallytime.SecondtimeoutWhy
The old test path occasionally hit startup/timing races under
-race, and could return a pseudo region error (EpochNotMatch) before the assertion path was stable.Result
MockTikvServicego test -race ./internal/locate -run TestRegionRequestToSingleStore/TestClusterIDInReq -count=300 -failfastgo test -race ./internal/locateSummary by CodeRabbit