Skip to content

Commit

Permalink
Improve retry logic (shipwright-io#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaschaSchwarze0 authored Jun 4, 2020
1 parent 42f127f commit 759f9b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ func clientGet(key types.NamespacedName, obj runtime.Object) error {
return wait.PollImmediate(4*time.Second, 60*time.Second, func() (bool, error) {
if err := f.Client.Get(goctx.TODO(), key, obj); err != nil {
// check if we have an error that we want to retry
if apierrors.IsServerTimeout(err) || apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) {
if apierrors.IsServerTimeout(err) || apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) || err.Error() == "etcdserver: request timed out" {
Logf("Error during client get is retried: '%s'", err.Error())
return false, nil
} else {
Logf("Error during client get is not retried: '%s'", err.Error())
}

// return all other errors directly
Expand Down

0 comments on commit 759f9b8

Please sign in to comment.