Skip to content

Commit

Permalink
remove retry after logic
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveromahony committed Dec 16, 2024
1 parent a071c7d commit 525e012
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions test/integration/grpc_management_plane_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ package integration

import (
"context"
"crypto/rand"
"encoding/json"
"fmt"
"math/big"
"net"
"net/http"
"os"
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit 525e012

Please sign in to comment.