Skip to content

Commit 8e592b3

Browse files
oilbeaterclaude
andauthored
fix: add retry logic to vpc-egress-gateway e2e curl connectivity check (#6345)
The curl command in checkEgressAccess() used RunHostCmdOrDie which fails immediately without retry. This causes flaky failures because VEG Status.Ready only indicates control plane readiness, while the OVN dataplane (NB→SB propagation, ovn-controller flow installation, BFD session establishment) may still be converging. Replace RunHostCmdOrDie with WaitUntil + RunHostCmd to retry for up to 30 seconds, matching the pattern already used by CheckPodEgressRoutes. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f5b5274 commit 8e592b3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/e2e/vpc-egress-gateway/e2e_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,15 @@ func checkEgressAccess(f *framework.Framework, namespaceName, svrPodName, image,
455455
ginkgo.By("Checking connection from " + pod.Name + " to " + svrIP + " via " + protocol)
456456
cmd := fmt.Sprintf("curl -q -s --connect-timeout 2 --max-time 2 %s/clientip", net.JoinHostPort(svrIP, svrPort))
457457
ginkgo.By(fmt.Sprintf(`Executing %q in pod %s/%s`, cmd, pod.Namespace, pod.Name))
458-
output := e2epodoutput.RunHostCmdOrDie(pod.Namespace, pod.Name, cmd)
459-
clientIP, _, err := net.SplitHostPort(strings.TrimSpace(output))
460-
framework.ExpectNoError(err)
458+
var clientIP string
459+
framework.WaitUntil(2*time.Second, 30*time.Second, func(_ context.Context) (bool, error) {
460+
output, err := e2epodoutput.RunHostCmd(pod.Namespace, pod.Name, cmd)
461+
if err != nil {
462+
return false, nil
463+
}
464+
clientIP, _, err = net.SplitHostPort(strings.TrimSpace(output))
465+
return err == nil, nil
466+
}, fmt.Sprintf("curl %s from pod %s/%s", net.JoinHostPort(svrIP, svrPort), pod.Namespace, pod.Name))
461467
framework.ExpectContainElement(expectedClientIPs, clientIP)
462468
}
463469
}

0 commit comments

Comments
 (0)