From 5537b6007c297e3326dd8315d8ab523483c8326b Mon Sep 17 00:00:00 2001 From: Ingo Gottwald Date: Thu, 1 Oct 2020 11:00:36 +0200 Subject: [PATCH] Fix bug in rate limit race test According to the Go testing package documentation FailNow must be called from the goroutine running the test, not from other goroutines created during the test. A simple error without fatal seems to be sufficient for this test. --- godo_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godo_test.go b/godo_test.go index 289b3da..fe33cb4 100644 --- a/godo_test.go +++ b/godo_test.go @@ -402,7 +402,7 @@ func TestDo_rateLimitRace(t *testing.T) { req, _ := client.NewRequest(ctx, http.MethodGet, "/", nil) _, err := client.Do(context.Background(), req, nil) if err != nil { - t.Fatalf("Do(): %v", err) + t.Errorf("Do(): %v", err) } wg.Done() }()