tests: stabilize TestUpdateMemberWhenRecovery#10442
Conversation
Signed-off-by: okjiang <819421878@qq.com>
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between a48b7a2192653413340d4dd8380d4b522ab31722 and 8b8fb94. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdjusts TestUpdateMemberWhenRecovery to detect TSO recovery by composing observed physical+logical timestamps: runs an async GetTS during a node restart, then repeatedly consumes in-flight or retried GetTS results to compute a recoveredTS and assert recoveredTS > initialTS, cancelling the original context afterward. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10442 +/- ##
==========================================
+ Coverage 78.86% 78.90% +0.04%
==========================================
Files 529 530 +1
Lines 71102 71548 +446
==========================================
+ Hits 56072 56456 +384
- Misses 11014 11072 +58
- Partials 4016 4020 +4
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
| return err == nil | ||
| }, testutil.WithWaitFor(60*time.Second), testutil.WithTickInterval(500*time.Millisecond)) | ||
| } | ||
| // The in-flight GetTS may stay attached to stale discovery/metadata during |
There was a problem hiding this comment.
The test goal has changed here: the original in-flight GetTS sent through resultCh no longer has to recover by itself; the test now passes as long as either that request or a fresh retry gets a newer TS after recovery.
I think the comments should be updated to match. Phrases like “will wait for TSO service to recover” and “Verify GetTS succeeds after node restart” still read more like they describe the original blocked request, which no longer matches the actual assertion.
There was a problem hiding this comment.
Updated the function header and the Step 5/6/7 comments to match the current assertion: we now describe eventual recovery, where either the in-flight request or a fresh retry can observe the recovered TSO service and return a newer TS. The wording no longer implies the original blocked request must recover by itself.
There was a problem hiding this comment.
Rechecked this thread: commit a48b7a219 updates the function header and the Step 5/6/7 comments to describe eventual recovery correctly, so the wording no longer implies the original in-flight request must recover by itself. The PR head is already at that commit.\n\n
Signed-off-by: okjiang <819421878@qq.com>
a48b7a2 to
8b8fb94
Compare
|
/retest |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lhy1024, rleungx 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 |
|
/retest |
1 similar comment
|
/retest |
What problem does this PR solve?
Issue Number: Close #9994
TestUpdateMemberWhenRecoveryis flaky when all TSO nodes are stopped and one node is restarted.The blocked
GetTSrequest can stay attached to stale discovery or keyspace-group metadata long enough to hit its timeout even though the recovered TSO service is already able to serve fresh requests.What is changed and how does it work?
Instead of waiting only on the original in-flight
GetTSresult, the test now treats recovery as successful when either:GetTSretry returns a newer TS after the service recovers.This keeps the original no-legacy-fallback assertion, but removes the timing dependency on when the first blocked request rebinds to refreshed TSO discovery.
Verification:
cd tests/integrations && GOCACHE=/tmp/pd-gocache GOTMPDIR=/tmp/pd-gotmp make gotest GOTEST_ARGS='-tags=without_dashboard ./mcs/keyspace -run TestKeyspaceGroupTestSuite/TestUpdateMemberWhenRecovery -count=5 -v'-> PASS (5/5,ok ... 66.772s)GOCACHE=/tmp/pd-gocache GOTMPDIR=/tmp/pd-gotmp make basic-test-> FAIL in unrelated packagespkg/gctuner,pkg/schedule/operator, andpkg/storage/endpointCheck List
Tests
Release note
Summary by CodeRabbit
Tests
Refactor