Skip to content

Commit

Permalink
tests/api: add wait leader for api (#8540)
Browse files Browse the repository at this point in the history
close #8513

tests/api: add wait leader for api

Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp authored Aug 16, 2024
1 parent 1b8fc6a commit 4b0878e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/server/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ func (suite *middlewareTestSuite) SetupSuite() {
suite.cluster = cluster
}

func (suite *middlewareTestSuite) SetupTest() {
re := suite.Require()
re.NotEmpty(suite.cluster.WaitLeader())
leader := suite.cluster.GetLeaderServer()
re.NotNil(leader)
}

func (suite *middlewareTestSuite) TearDownSuite() {
re := suite.Require()
re.NoError(failpoint.Disable("github.com/tikv/pd/server/api/enableFailpointAPI"))
Expand Down

0 comments on commit 4b0878e

Please sign in to comment.