Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
MqllR committed Dec 6, 2023
1 parent 6706169 commit 7b370e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
4 changes: 2 additions & 2 deletions storage/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b370e3

Please sign in to comment.