From 07b7c25b5b87d0f358f985d386e0295e12ca3c19 Mon Sep 17 00:00:00 2001 From: Patrick Rice Date: Mon, 19 Aug 2024 14:22:05 +0000 Subject: [PATCH] Fix linting error --- gitlab_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitlab_test.go b/gitlab_test.go index 02a69b18c..b07631fd5 100644 --- a/gitlab_test.go +++ b/gitlab_test.go @@ -442,7 +442,7 @@ func TestExponentialBackoffLogic(t *testing.T) { // Send a request (which will get a bunch of 429s) // None of the responses matter, so ignore them all - _, _, _ = client.Projects.GetProject(1, nil) + _, resp, _ := client.Projects.GetProject(1, nil) end := time.Now() // The test should run for _at least_ 3,200 milliseconds @@ -450,4 +450,7 @@ func TestExponentialBackoffLogic(t *testing.T) { if duration < float64(3200*time.Millisecond) { t.Fatal("Wait was shorter than expected. Expected a minimum of 5 retries taking 3200 milliseconds, got:", duration) } + if resp.StatusCode != 429 { + t.Fatal("Expected to get a 429 code given the server is hard-coded to return this. Received instead:", resp.StatusCode) + } }