Skip to content

Commit

Permalink
add an ut
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Nov 5, 2024
1 parent 97fb08a commit c7af65f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/pdctl/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,13 @@ func TestEvictLeaderScheduler(t *testing.T) {
output, err := pdctl.ExecuteCommand(cmd, []string{"-u", pdAddr, "scheduler", "add", "evict-leader-scheduler", "2"}...)
re.NoError(err)
re.Contains(string(output), "Success!")
re.False(false, leaderServer.GetRaftCluster().GetStore(2).AllowLeaderTransfer())
// execute twice to verify this issue: https://github.com/tikv/pd/issues/8756
output, err = pdctl.ExecuteCommand(cmd, []string{"-u", pdAddr, "scheduler", "add", "evict-leader-scheduler", "2"}...)
re.NoError(err)
re.Contains(string(output), "Success!")
re.False(false, leaderServer.GetRaftCluster().GetStore(2).AllowLeaderTransfer())

failpoint.Enable("github.com/tikv/pd/pkg/schedule/schedulers/buildWithArgsErr", "return(true)")
output, err = pdctl.ExecuteCommand(cmd, []string{"-u", pdAddr, "scheduler", "add", "evict-leader-scheduler", "1"}...)
re.NoError(err)
Expand Down

0 comments on commit c7af65f

Please sign in to comment.