Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLAKEY_TEST: Add retry to outbound request for ProxyLifecycleShutdown… #3999

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestAPIGateway_GatewayClassConfig(t *testing.T) {
checkConsulExists(t, consulClient, api.APIGateway, gatewayName)

// Scenario: Gateway deployment should match the default instances defined on the gateway class config
logger.Log(t, "checking that gateway instances match defined gateway class config")
// checking that gateway instances match defined gateway class config
checkNumberOfInstances(t, k8sClient, consulClient, gateway.Name, gateway.Namespace, defaultInstances, gateway)

// Scenario: Updating the GatewayClassConfig should not affect gateways that have already been created
Expand Down Expand Up @@ -177,7 +177,7 @@ func scale(t *testing.T, client client.Client, name, namespace string, scaleTo *
func checkNumberOfInstances(t *testing.T, k8client client.Client, consulClient *api.Client, name, namespace string, wantNumber *int32, gateway *gwv1beta1.Gateway) {
t.Helper()

retryCheckWithWait(t, 30, 10*time.Second, func(r *retry.R) {
retryCheckWithWait(t, 40, 10*time.Second, func(r *retry.R) {
logger.Log(t, "checking that gateway instances match defined gateway class config")
logger.Log(t, fmt.Sprintf("want: %d", *wantNumber))

Expand Down
14 changes: 11 additions & 3 deletions acceptance/tests/connect/connect_proxy_lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,17 @@ func TestConnectInject_ProxyLifecycleShutdown(t *testing.T) {
case <-gracePeriodTimer.C:
break gracePeriodLoop
default:
output, err := k8s.RunKubectlAndGetOutputE(t, ctx.KubectlOptions(t), args...)
require.NoError(t, err)
require.True(t, !strings.Contains(output, "curl: (7) Failed to connect"))
retrier := &retry.Counter{Count: 3, Wait: 1 * time.Second}
retry.RunWith(retrier, t, func(r *retry.R) {
output, err := k8s.RunKubectlAndGetOutputE(r, ctx.KubectlOptions(t), args...)
if err != nil {
r.Errorf(err.Error())
return
}
require.Condition(r, func() bool {
return !strings.Contains(output, "curl: (7) Failed to connect")
}, fmt.Sprintf("Error: %s", output))
})

// If listener draining is disabled, ensure inbound
// requests are accepted during grace period.
Expand Down
Loading