From 2b488085ede79ad14fe26b73f217564744f3338b Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Sat, 14 Sep 2024 15:36:06 +0800 Subject: [PATCH] add-remove-add test Signed-off-by: lhy1024 --- tools/pd-ctl/tests/scheduler/scheduler_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/pd-ctl/tests/scheduler/scheduler_test.go b/tools/pd-ctl/tests/scheduler/scheduler_test.go index f680a4bd2e7d..6659343d1ebc 100644 --- a/tools/pd-ctl/tests/scheduler/scheduler_test.go +++ b/tools/pd-ctl/tests/scheduler/scheduler_test.go @@ -327,6 +327,15 @@ func (suite *schedulerTestSuite) checkScheduler(cluster *pdTests.TestCluster) { echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "remove", "evict-leader-scheduler-1"}, nil) re.Contains(echo, "Unable to update config: scheduler evict-leader-scheduler does not exist.") + echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "add", "evict-leader-scheduler", "1"}, nil) + re.Equal("Success! The scheduler is created.\n", echo) + echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "add", "evict-leader-scheduler", "2"}, nil) + re.Equal("Success! The scheduler has been applied to the store.\n", echo) + + echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "config", "evict-leader-scheduler"}, nil) + re.Contains(echo, "2") + re.Contains(echo, "1") + // test remove and add echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "remove", "balance-hot-region-scheduler"}, nil) re.Contains(echo, "Success")