From 525e01287dacf22b9f18fc2d351edb11cf4c96cd Mon Sep 17 00:00:00 2001 From: Oliver O'Mahony Date: Mon, 16 Dec 2024 11:25:31 +0000 Subject: [PATCH] remove retry after logic --- .../grpc_management_plane_api_test.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/test/integration/grpc_management_plane_api_test.go b/test/integration/grpc_management_plane_api_test.go index 4cfecddfd..184fc405c 100644 --- a/test/integration/grpc_management_plane_api_test.go +++ b/test/integration/grpc_management_plane_api_test.go @@ -7,10 +7,8 @@ package integration import ( "context" - "crypto/rand" "encoding/json" "fmt" - "math/big" "net" "net/http" "os" @@ -71,21 +69,10 @@ func setupClient() *resty.Client { client.SetRetryCount(retryCount) client.SetRetryWaitTime(retryWaitTime) client.SetRetryMaxWaitTime(retryMaxWaitTime) - client.SetRetryAfter(retryAfter) return client } -func retryAfter(_ *resty.Client, _ *resty.Response) (time.Duration, error) { - nBig, err := rand.Int(rand.Reader, big.NewInt(100)) - if err != nil { - return 0, err - } - n := nBig.Int64() - - return time.Duration(n) * time.Millisecond, nil -} - func setupConnectionTest(tb testing.TB, expectNoErrorsInLogs, nginxless bool) func(tb testing.TB) { tb.Helper() ctx := context.Background() @@ -411,7 +398,9 @@ func TestGrpc_DataplaneHealthRequest(t *testing.T) { }` url := fmt.Sprintf("http://%s/api/v1/requests", mockManagementPlaneAPIAddress) - resp, err := setupClient().R().EnableTrace().SetBody(request).Post(url) + client := resty.New() + client.SetRetryCount(retryCount).SetRetryWaitTime(retryWaitTime).SetRetryMaxWaitTime(retryMaxWaitTime) + resp, err := client.R().EnableTrace().SetBody(request).Post(url) require.NoError(t, err) assert.Equal(t, http.StatusOK, resp.StatusCode())