Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pd-ctl: make TestShowKeyspaceGroupPrimary stable #6903

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/pdctl/keyspace/keyspace_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,13 @@ func TestShowKeyspaceGroupPrimary(t *testing.T) {
args := []string{"-u", pdAddr, "keyspace-group"}
output, err := pdctl.ExecuteCommand(cmd, append(args, "1")...)
re.NoError(err)
if strings.Contains(string(output), "Failed") {
// It may be failed when meets error, such as [PD:etcd:ErrEtcdTxnConflict]etcd transaction failed, conflicted and rolled back
fmt.Println(string(output))
lhy1024 marked this conversation as resolved.
Show resolved Hide resolved
return false
}
err = json.Unmarshal(output, &keyspaceGroup)
re.NoErrorf(err, "output: %s", string(output))
re.NoError(err)
return len(keyspaceGroup.Members) == 2
})
for _, member := range keyspaceGroup.Members {
Expand Down