Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Fix slow tests by disabling retry backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
armsnyder committed Dec 11, 2022
1 parent 05207f5 commit 21ae872
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gitlab_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"os"
"strings"
"testing"
"time"

retryablehttp "github.com/hashicorp/go-retryablehttp"
)
Expand All @@ -44,7 +45,13 @@ func setup(t *testing.T) (*http.ServeMux, *httptest.Server, *Client) {
server := httptest.NewServer(mux)

// 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 {
server.Close()
t.Fatalf("Failed to create client: %v", err)
Expand Down

0 comments on commit 21ae872

Please sign in to comment.