Skip to content

Commit

Permalink
Backport of FLAKEY_TEST: Add retry to outbound request for ProxyLifec…
Browse files Browse the repository at this point in the history
…ycleShutdown… into release/1.1.x (#4004)

backport of commit b547902

Co-authored-by: NiniOak <[email protected]>
  • Loading branch information
hc-github-team-consul-core and NiniOak authored May 17, 2024
1 parent 96f1d49 commit f263ba2
Showing 1 changed file with 11 additions and 3 deletions.
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 enabled, ensure inbound
// requests are rejected during grace period.
Expand Down

0 comments on commit f263ba2

Please sign in to comment.