Skip to content

Commit

Permalink
Merge branch 'master' into add-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot[bot] authored Jul 22, 2024
2 parents f94ebce + 7b014aa commit 2d8df03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion tools/pd-ctl/pdctl/command/store_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,11 @@ func showAllStoresLimitCommandFunc(cmd *cobra.Command, args []string) {
cmd.Println(r)
}

func removeTombStoneCommandFunc(cmd *cobra.Command, _ []string) {
func removeTombStoneCommandFunc(cmd *cobra.Command, args []string) {
if len(args) != 0 {
cmd.Usage()
return
}
prefix := path.Join(storesPrefix, "remove-tombstone")
_, err := doRequest(cmd, prefix, http.MethodDelete, http.Header{})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tools/pd-ctl/pdctl/ctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
)

func init() {
cobra.EnablePrefixMatching = true
cobra.EnablePrefixMatching = false
cobra.EnableTraverseRunHooks = true
}

Expand Down
7 changes: 6 additions & 1 deletion tools/pd-ctl/tests/store/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,14 @@ func TestStore(t *testing.T) {
// store delete <store_id> command
storeInfo.Store.State = metapb.StoreState(metapb.StoreState_value[storeInfo.Store.StateName])
re.Equal(metapb.StoreState_Up, storeInfo.Store.State)
args = []string{"-u", pdAddr, "store", "remove", "1"} // it means remove-tombstone
output, err = tests.ExecuteCommand(cmd, args...)
re.NoError(err)
re.NotContains(string(output), "Success")
args = []string{"-u", pdAddr, "store", "delete", "1"}
_, err = tests.ExecuteCommand(cmd, args...)
output, err = tests.ExecuteCommand(cmd, args...)
re.NoError(err)
re.Contains(string(output), "Success")
args = []string{"-u", pdAddr, "store", "1"}
output, err = tests.ExecuteCommand(cmd, args...)
re.NoError(err)
Expand Down

0 comments on commit 2d8df03

Please sign in to comment.