Skip to content

Commit

Permalink
change error msg
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Sep 6, 2024
1 parent d0c59f6 commit 1f22980
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tools/pd-ctl/pdctl/command/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ func addStoreToSchedulerConfig(cmd *cobra.Command, schedulerName string, args []
return
}
if !exist {
cmd.Printf("Failed! scheduler %s not found.\n", schedulerName)
cmd.Printf("Unable to update config: scheduler %s does not exist.\n", schedulerName)
return
}

Expand Down Expand Up @@ -783,7 +783,7 @@ func deleteStoreFromSchedulerConfig(cmd *cobra.Command, schedulerName string, ar
return
}
if !exist {
cmd.Printf("Failed! scheduler %s not found.\n", schedulerName)
cmd.Printf("Unable to update config: scheduler %s does not exist.\n", schedulerName)
return
}

Expand Down
4 changes: 2 additions & 2 deletions tools/pd-ctl/tests/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (suite *schedulerTestSuite) checkScheduler(cluster *pdTests.TestCluster) {
// will fail because the scheduler is not existed
args = []string{"-u", pdAddr, "scheduler", "config", schedulers[idx], "add-store", "3"}
output := mustExec(re, cmd, args, nil)
re.Contains(output, fmt.Sprintf("Failed! scheduler %s not found", schedulers[idx]))
re.Contains(output, fmt.Sprintf("Unable to update config: scheduler %s does not exist.", schedulers[idx]))

// scheduler add command
args = []string{"-u", pdAddr, "scheduler", "add", schedulers[idx], "2"}
Expand Down Expand Up @@ -321,7 +321,7 @@ func (suite *schedulerTestSuite) checkScheduler(cluster *pdTests.TestCluster) {
echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "remove", "evict-leader-scheduler-2"}, nil)
re.Contains(echo, "Success!")
echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "remove", "evict-leader-scheduler-1"}, nil)
re.Contains(echo, "Failed! scheduler evict-leader-scheduler not found")
re.Contains(echo, "Unable to update config: scheduler evict-leader-scheduler does not exist.")
testutil.Eventually(re, func() bool { // wait for removed scheduler to be synced to scheduling server.
echo = mustExec(re, cmd, []string{"-u", pdAddr, "scheduler", "config", "evict-leader-scheduler"}, nil)
return strings.Contains(echo, "[404] scheduler not found")
Expand Down

0 comments on commit 1f22980

Please sign in to comment.