From 7b370e3224e766f04db1479322e23a14af380888 Mon Sep 17 00:00:00 2001 From: Mael Regnery Date: Wed, 6 Dec 2023 14:10:25 +0100 Subject: [PATCH] fix test --- storage/s3.go | 5 ----- storage/s3_test.go | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/storage/s3.go b/storage/s3.go index 5676c0e57..94bbdffd0 100644 --- a/storage/s3.go +++ b/storage/s3.go @@ -1339,11 +1339,6 @@ func newCustomRetryer(sc *SessionCache, maxRetries int) *customRetryer { // ShouldRetry overrides SDK's built in DefaultRetryer, adding custom retry // logics that are not included in the SDK. func (c *customRetryer) ShouldRetry(req *request.Request) bool { - log.Error(log.ErrorMessage{ - Command: "retrier", - Err: req.Error.Error(), - }) - shouldRetry := errHasCode(req.Error, "InternalError") || errHasCode(req.Error, "RequestTimeTooSkewed") || errHasCode(req.Error, "SlowDown") || strings.Contains(req.Error.Error(), "connection reset") || strings.Contains(req.Error.Error(), "connection timed out") || errHasCode(req.Error, "ExpiredToken") || errHasCode(req.Error, "ExpiredTokenException") if errHasCode(req.Error, "ExpiredToken") || errHasCode(req.Error, "ExpiredTokenException") { diff --git a/storage/s3_test.go b/storage/s3_test.go index 36a7d9f51..6dafa628a 100644 --- a/storage/s3_test.go +++ b/storage/s3_test.go @@ -489,12 +489,12 @@ func TestS3Retry(t *testing.T) { { name: "ExpiredToken", err: awserr.New("ExpiredToken", "expired token", nil), - expectedRetry: 0, + expectedRetry: 5, }, { name: "ExpiredTokenException", err: awserr.New("ExpiredTokenException", "expired token exception", nil), - expectedRetry: 0, + expectedRetry: 5, }, // Invalid Token errors