Skip to content

Commit

Permalink
test: fix timeout for PeeringGateway acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
DanStough committed May 14, 2024
1 parent 6db22a7 commit 9b07eed
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions acceptance/tests/peering/peering_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,17 @@ import (
"time"

terratestk8s "github.com/gruntwork-io/terratest/modules/k8s"
"github.com/hashicorp/consul-k8s/acceptance/framework/consul"
"github.com/hashicorp/consul-k8s/acceptance/framework/helpers"
"github.com/hashicorp/consul-k8s/acceptance/framework/k8s"
"github.com/hashicorp/consul-k8s/acceptance/framework/logger"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/sdk/testutil/retry"
"github.com/hashicorp/go-version"
"github.com/stretchr/testify/require"
"k8s.io/apimachinery/pkg/types"

"github.com/hashicorp/consul-k8s/acceptance/framework/consul"
"github.com/hashicorp/consul-k8s/acceptance/framework/helpers"
"github.com/hashicorp/consul-k8s/acceptance/framework/k8s"
"github.com/hashicorp/consul-k8s/acceptance/framework/logger"

gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
)

Expand Down Expand Up @@ -251,9 +252,9 @@ func TestPeering_Gateway(t *testing.T) {

// On startup, the controller can take upwards of 1m to perform
// leader election so we may need to wait a long time for
// the reconcile loop to run (hence the 1m timeout here).
// the reconcile loop to run (hence the 2m timeout here).
var gatewayAddress string
counter := &retry.Counter{Count: 10, Wait: 2 * time.Second}
counter := &retry.Counter{Count: 60, Wait: 2 * time.Second}
retry.RunWith(counter, t, func(r *retry.R) {
var gateway gwv1beta1.Gateway
err := k8sClient.Get(context.Background(), types.NamespacedName{Name: "gateway", Namespace: staticClientNamespace}, &gateway)
Expand Down

0 comments on commit 9b07eed

Please sign in to comment.