Skip to content

Commit ebd538b

Browse files
infernus01chmouel
authored andcommitted
fix(gitlab): disable retry logic in test client
The GitLab Go client has built-in retry logic for HTTP 5xx errors. Tests that return HTTP 500 were triggering this retry behavior, causing test execution time to exceed 60 seconds. Add gitlab.WithoutRetries() option when creating the test client to disable retries for tests. This reduces GitLab provider test execution from ~61s to ~1s. Signed-off-by: Shubham Bhardwaj <[email protected]>
1 parent 605306d commit ebd538b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/provider/gitlab/test/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func Setup(t *testing.T) (*gitlab.Client, *http.ServeMux, func()) {
3535
server.Close()
3636
}
3737

38-
client, err := gitlab.NewClient("token", gitlab.WithBaseURL(server.URL))
38+
client, err := gitlab.NewClient("token", gitlab.WithBaseURL(server.URL), gitlab.WithoutRetries())
3939
assert.NilError(t, err)
4040
return client, mux, tearDown
4141
}

0 commit comments

Comments
 (0)