Skip to content
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: add more info for TestDisableSchedulingServiceFallback #8946

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/integrations/mcs/scheduling/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (suite *serverTestSuite) TestAllocIDAfterLeaderChange() {
re := suite.Require()
re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/scheduling/server/fastUpdateMember", `return(true)`))
pd2, err := suite.cluster.Join(suite.ctx)
re.NoError(err)
re.NoError(err, "error: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it fails, it will print the error. So why do you add this?🤔

err = pd2.Run()
re.NotEmpty(suite.cluster.WaitLeader())
re.NoError(err)
Expand Down Expand Up @@ -261,6 +261,8 @@ func (suite *serverTestSuite) TestDisableSchedulingServiceFallback() {

// API server will execute scheduling jobs since there is no scheduling server.
testutil.Eventually(re, func() bool {
re.NotNil(suite.pdLeader.GetServer())
re.NotNil(suite.pdLeader.GetServer().GetRaftCluster())
return suite.pdLeader.GetServer().GetRaftCluster().IsSchedulingControllerRunning()
Comment on lines 263 to 266
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about return suite.pdLeader.GetServer()!=nil && suite.pdLeader.GetServer().GetRaftCluster()!=nil && suite.pdLeader.GetServer().GetRaftCluster().IsSchedulingControllerRunning()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to see who is nil.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re.NotNil also will make test unstable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about change titile to test: add more info for TestDisableSchedulingServiceFallback?

})
leaderServer := suite.pdLeader.GetServer()
Expand Down
Loading