Skip to content

Commit

Permalink
e2e framework retry on Service unavailable errors
Browse files Browse the repository at this point in the history
the e2e framwork use active loops to wait for certain async operations,
these loops need to retry on some operations and fail in others.

For the functions that depend on some operations to happen, the
apiserver may return 503 errors until that specific service is
available, so we should retry on those too.

Change-Id: Ib3d194184f6385b9d3d151c7055f27c97c21c3ff
  • Loading branch information
aojea committed May 26, 2023
1 parent 916bc55 commit 7888798
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/framework/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ func ShouldRetry(err error) (retry bool, retryAfter time.Duration) {
}

// these errors indicate a transient error that should be retried.
if apierrors.IsTimeout(err) || apierrors.IsTooManyRequests(err) || errors.As(err, &transientError{}) {
if apierrors.IsTimeout(err) ||
apierrors.IsTooManyRequests(err) ||
apierrors.IsServiceUnavailable(err) ||
errors.As(err, &transientError{}) {
return true, 0
}

Expand Down

0 comments on commit 7888798

Please sign in to comment.