From df05355fb13d715cc6189ebfeeba37513b64c29b Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 17 Jan 2025 12:29:45 -0600
Subject: [PATCH] fix(deps): update module github.com/cenkalti/backoff/v4 to v5
(#286)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/cenkalti/backoff/v4](https://redirect.github.com/cenkalti/backoff)
| `v4.3.0` -> `v5.0.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcenkalti%2fbackoff%2fv4/v5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fcenkalti%2fbackoff%2fv4/v5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.3.0/v5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcenkalti%2fbackoff%2fv4/v4.3.0/v5.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
---
### Release Notes
cenkalti/backoff (github.com/cenkalti/backoff/v4)
###
[`v5.0.1`](https://redirect.github.com/cenkalti/backoff/compare/v5.0.0...v5.0.1)
[Compare
Source](https://redirect.github.com/cenkalti/backoff/compare/v5.0.0...v5.0.1)
###
[`v5.0.0`](https://redirect.github.com/cenkalti/backoff/compare/v4.3.0...v5.0.0)
[Compare
Source](https://redirect.github.com/cenkalti/backoff/compare/v4.3.0...v5.0.0)
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
â™» **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/infratographer/x).
---------
Signed-off-by: Mike Mason
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mike Mason
---
echox/echo_test.go | 21 +++++++++++----------
go.mod | 3 ++-
go.sum | 2 ++
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/echox/echo_test.go b/echox/echo_test.go
index 9ffb875..7b1839a 100644
--- a/echox/echo_test.go
+++ b/echox/echo_test.go
@@ -16,7 +16,7 @@ import (
"testing"
"time"
- "github.com/cenkalti/backoff/v4"
+ "github.com/cenkalti/backoff/v5"
"github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -28,8 +28,8 @@ import (
)
const (
- maxRetries = 10
- backoffDuration = 5 * time.Millisecond
+ maxRetries uint = 10
+ backoffDuration = 5 * time.Millisecond
)
type testRoute struct {
@@ -82,27 +82,28 @@ func testServer(t *testing.T, config Config, preRun func(srv *Server)) (*Server,
func waitForServer(t *testing.T, testURL string) {
t.Helper()
- err := backoff.Retry(
- func() error {
+ _, err := backoff.Retry(context.Background(),
+ func() (struct{}, error) {
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, testURL, nil)
if err != nil {
- return err
+ return struct{}{}, err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
- return err
+ return struct{}{}, err
}
defer resp.Body.Close() //nolint:errcheck // no need to check error in test
if resp.StatusCode != http.StatusOK {
- return fmt.Errorf("unexpected status code: %d", resp.StatusCode) //nolint:err113 // this is fine for a test
+ return struct{}{}, fmt.Errorf("unexpected status code: %d", resp.StatusCode) //nolint:err113 // this is fine for a test
}
- return nil
+ return struct{}{}, nil
},
- backoff.WithMaxRetries(backoff.NewConstantBackOff(backoffDuration), maxRetries),
+ backoff.WithBackOff(backoff.NewConstantBackOff(backoffDuration)),
+ backoff.WithMaxTries(maxRetries),
)
require.NoError(t, err, "error waiting for server to be ready")
diff --git a/go.mod b/go.mod
index 2349fcc..c939088 100644
--- a/go.mod
+++ b/go.mod
@@ -65,6 +65,7 @@ require (
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/bytedance/sonic v1.12.6 // indirect
github.com/bytedance/sonic/loader v0.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/containerd/containerd v1.7.18 // indirect
@@ -135,7 +136,7 @@ require (
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.3.0
+ github.com/cenkalti/backoff/v5 v5.0.1
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
diff --git a/go.sum b/go.sum
index 22a5b47..2bdd388 100644
--- a/go.sum
+++ b/go.sum
@@ -47,6 +47,8 @@ github.com/bytedance/sonic/loader v0.2.1 h1:1GgorWTqf12TA8mma4DDSbaQigE2wOgQo7iC
github.com/bytedance/sonic/loader v0.2.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cenkalti/backoff/v5 v5.0.1 h1:kGZdCHH1+eW+Yd0wftimjMuhg9zidDvNF5aGdnkkb+U=
+github.com/cenkalti/backoff/v5 v5.0.1/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y=