diff --git a/gitlab_test.go b/gitlab_test.go index a61efd71d..27b63ac1a 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -27,6 +27,7 @@ import ( "os" "strings" "testing" + "time" retryablehttp "github.com/hashicorp/go-retryablehttp" ) @@ -45,7 +46,13 @@ func setup(t *testing.T) (*http.ServeMux, *Client) { t.Cleanup(server.Close) // client is the Gitlab client being tested. - client, err := NewClient("", WithBaseURL(server.URL)) + client, err := NewClient("", + WithBaseURL(server.URL), + // Disable backoff to speed up tests that expect errors. + WithCustomBackoff(func(_, _ time.Duration, _ int, _ *http.Response) time.Duration { + return 0 + }), + ) if err != nil { t.Fatalf("Failed to create client: %v", err) }