Skip to content

Commit

Permalink
*: remove the previous joined pd (tikv#8562)
Browse files Browse the repository at this point in the history
close tikv#7954

Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored Aug 27, 2024
1 parent 6998fb5 commit 09e272f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ func (c *TestCluster) StopAll() error {
return nil
}

// DeleteServer is used to delete a server.
func (c *TestCluster) DeleteServer(name string) {
delete(c.servers, name)
}

// GetServer returns a server with a given name.
func (c *TestCluster) GetServer(name string) *TestServer {
return c.servers[name]
Expand Down
14 changes: 14 additions & 0 deletions tests/integrations/mcs/scheduling/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,20 @@ 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 09e272f

Please sign in to comment.