Skip to content

Commit

Permalink
refine
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored and ti-chi-bot committed Sep 24, 2024
1 parent 1691fdd commit 32862e5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/e2e/tidbcluster/across-kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,18 @@ var _ = ginkgo.Describe("[Across Kubernetes]", func() {
ginkgo.By("Update pd's peerURL of cluster-1")
pdAddr := fmt.Sprintf("%s:%d", localHost, localPort)
var resp *pdutil.GetMembersResponse
err = retry.OnError(retry.DefaultRetry, func(e error) bool { return e != nil }, func() error {
err = wait.PollImmediate(5*time.Second, 5*time.Minute, func() (bool, error) {
// it seems the above `WaitForTidbClusterReady` may return before the pd server is ready
// so we need to retry here
resp, err = pdutil.GetMembersV2(pdAddr)
return err
if err != nil {
log.Logf("failed to get pd members of cluster-1 %s/%s, %v", tc1.Namespace, tc1.Name, err)
return false, err
}
if len(resp.Members) == 0 {
return false, nil
}
return true, nil
})
framework.ExpectNoError(err, " failed to get pd members of cluster-1 %s/%s", tc1.Namespace, tc1.Name)
for _, member := range resp.Members {
Expand Down

0 comments on commit 32862e5

Please sign in to comment.