diff --git a/.taskcluster.yml b/.taskcluster.yml index 6b8db2a..d6b81dc 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -63,4 +63,4 @@ tasks: name: httpbackoff CI description: builds and tests httpbackoff owner: taskcluster-internal@mozilla.com - source: ${event.repository.url} + source: ${event.repository.url} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 768ca27..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: go - -env: - - GO111MODULE=on -go: - - 1.15 - -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover - -script: - - go test -v -coverprofile=coverage.report - -after_script: - - go tool cover -func=coverage.report - - ${HOME}/gopath/bin/goveralls -coverprofile=coverage.report -service=travis-ci - -# currently cannot customise per user fork, see: -# https://github.com/travis-ci/travis-ci/issues/1094 -notifications: - irc: - channels: - - "irc.mozilla.org#taskcluster-bots" - on_success: change - on_failure: always - template: - - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}" - - "Change view : %{compare_url}" - - "Build details : %{build_url}" - - "Commit message : %{commit_message}" diff --git a/go.mod b/go.mod index 70022f4..a179dfb 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/taskcluster/httpbackoff/v3 require ( - github.com/cenkalti/backoff/v3 v3.2.2 - github.com/stretchr/testify v1.7.0 + github.com/cenkalti/backoff/v4 v4.2.1 + github.com/stretchr/testify v1.7.1 ) go 1.12 diff --git a/go.sum b/go.sum index 5d638d0..b7bd020 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,12 @@ -github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= -github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= +github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= +github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/httpbackoff.go b/httpbackoff.go index 1ce6435..3ce3a66 100644 --- a/httpbackoff.go +++ b/httpbackoff.go @@ -42,7 +42,7 @@ import ( "strconv" "time" - "github.com/cenkalti/backoff/v3" + "github.com/cenkalti/backoff/v4" ) var defaultClient Client = Client{ diff --git a/test_setup_test.go b/test_setup_test.go index b9904cf..8228a31 100644 --- a/test_setup_test.go +++ b/test_setup_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/cenkalti/backoff/v3" + "github.com/cenkalti/backoff/v4" ) var ( @@ -32,6 +32,9 @@ type HTTPResponse struct { // Fake auth endpoint func (handler *MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + if len(handler.QueuedResponses) == 0 { + return + } response := handler.QueuedResponses[0] handler.QueuedResponses = handler.QueuedResponses[1:] w.WriteHeader(response.statusCode)