-
Notifications
You must be signed in to change notification settings - Fork 728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: check leader not ready in test #8380
Conversation
Signed-off-by: okJiang <819421878@qq.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8380 +/- ##
==========================================
- Coverage 77.32% 77.16% -0.16%
==========================================
Files 470 470
Lines 61687 61689 +2
==========================================
- Hits 47701 47604 -97
- Misses 10405 10493 +88
- Partials 3581 3592 +11
Flags with carried forward coverage won't be shown. Click here to find out more. |
/cc @lhy1024 |
@@ -78,6 +78,7 @@ func (suite *resourceManagerClientTestSuite) SetupSuite() { | |||
suite.client, err = pd.NewClientWithContext(suite.ctx, suite.cluster.GetConfig().GetClientURLs(), pd.SecurityOption{}) | |||
re.NoError(err) | |||
leader := suite.cluster.GetServer(suite.cluster.WaitLeader()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to check whether suite.cluster.WaitLeader()
is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leader
will be nil and be checked in L81
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HuSharp, lhy1024 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: Ref #8350
It will be panic if leader is empty
What is changed and how does it work?
Check List
Tests
Code changes
Side effects
Related changes
pingcap/docs
/pingcap/docs-cn
:pingcap/tiup
:Release note