From f1deb7e70c90b5f0f1c61188f13a7484277c8d72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Burzy=C5=84ski?= Date: Mon, 23 Dec 2024 12:02:35 +0100 Subject: [PATCH] add backoff handling to SDK --- test/internal/helpers/konnect/control_plane.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/internal/helpers/konnect/control_plane.go b/test/internal/helpers/konnect/control_plane.go index 9df34e39c9..7c2278c9e5 100644 --- a/test/internal/helpers/konnect/control_plane.go +++ b/test/internal/helpers/konnect/control_plane.go @@ -9,7 +9,8 @@ import ( "testing" "time" - "github.com/avast/retry-go/v4" + sdkkonnectgo "github.com/Kong/sdk-konnect-go" + "github.com/Kong/sdk-konnect-go/retry" "github.com/google/uuid" "github.com/samber/lo" "github.com/stretchr/testify/assert" @@ -30,7 +31,16 @@ import ( func CreateTestControlPlane(ctx context.Context, t *testing.T) string { t.Helper() - sdk := sdk.New(accessToken(), serverURLOpt()) + sdk := sdk.New(accessToken(), serverURLOpt(), + sdkkonnectgo.WithRetryConfig(retry.Config{ + Backoff: &retry.BackoffStrategy{ + InitialInterval: 100, + MaxInterval: 2000, + Exponent: 1.2, + MaxElapsedTime: 10000, + }, + }), + ) var cpID string createRgErr := retry.Do(func() error {