Skip to content

Commit

Permalink
tests: fix local id panic (#8807)
Browse files Browse the repository at this point in the history
close #8642

Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored Nov 13, 2024
1 parent 9415fdc commit f941078
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/integrations/mcs/scheduling/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,8 @@ func (suite *apiTestSuite) checkAdminRegionCacheForward(cluster *tests.TestClust

func (suite *apiTestSuite) TestFollowerForward() {
suite.env.RunTestBasedOnMode(suite.checkFollowerForward)
suite.TearDownSuite()
suite.SetupSuite()
}

func (suite *apiTestSuite) checkFollowerForward(cluster *tests.TestCluster) {
Expand All @@ -517,20 +519,6 @@ func (suite *apiTestSuite) checkFollowerForward(cluster *tests.TestCluster) {
defer cancel()
follower, err := cluster.JoinAPIServer(ctx)
re.NoError(err)
defer func() {
leader := cluster.GetLeaderServer()
cli := leader.GetEtcdClient()
testutil.Eventually(re, func() bool {
_, err = cli.MemberRemove(context.Background(), follower.GetServer().GetMember().ID())
return err == nil
})
testutil.Eventually(re, func() bool {
res, err := cli.MemberList(context.Background())
return err == nil && len(res.Members) == 1
})
cluster.DeleteServer(follower.GetConfig().Name)
follower.Destroy()
}()
re.NoError(follower.Run())
re.NotEmpty(cluster.WaitLeader())

Expand Down

0 comments on commit f941078

Please sign in to comment.