From e7189cdd8b6d927244aa53ecc93b0a210b31a3db Mon Sep 17 00:00:00 2001 From: Periyasamy Palanisamy Date: Tue, 21 Jan 2025 13:20:43 +0100 Subject: [PATCH] Use max time for netpol pods curl requests The curl request is seen as waiting indefinitely though connect time set to 1s, so using max time as well so that it gets a chance for reconnection upon a failure. Signed-off-by: Periyasamy Palanisamy --- test/extended/networking/multinetpolicy.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/extended/networking/multinetpolicy.go b/test/extended/networking/multinetpolicy.go index 8b57bd97cf7c..e9c70c755a5d 100644 --- a/test/extended/networking/multinetpolicy.go +++ b/test/extended/networking/multinetpolicy.go @@ -140,12 +140,12 @@ func namespacePodShouldReach(oc *exutil.CLI, namespace, podName, address string) o.EventuallyWithOffset(1, func() error { var err error if namespace == "" { - out, err = oc.AsAdmin().Run("exec").Args(podName, "--", "curl", "--connect-timeout", "1", address).Output() + out, err = oc.AsAdmin().Run("exec").Args(podName, "--", "curl", "--connect-timeout", "1", "--max-time", "5", address).Output() } else { - out, err = oc.AsAdmin().Run("exec").Args(podName, "-n", namespace, "--", "curl", "--connect-timeout", "1", address).Output() + out, err = oc.AsAdmin().Run("exec").Args(podName, "-n", namespace, "--", "curl", "--connect-timeout", "1", "--max-time", "5", address).Output() } return err - }, "30s", "1s").ShouldNot(o.HaveOccurred(), "cmd output: %s", out) + }, "30s", "5s").ShouldNot(o.HaveOccurred(), "cmd output: %s", out) } func podShouldNotReach(oc *exutil.CLI, podName, address string) { @@ -157,12 +157,12 @@ func namespacePodShouldNotReach(oc *exutil.CLI, namespace, podName, address stri o.EventuallyWithOffset(1, func() error { var err error if namespace == "" { - out, err = oc.AsAdmin().Run("exec").Args(podName, "--", "curl", "--connect-timeout", "1", address).Output() + out, err = oc.AsAdmin().Run("exec").Args(podName, "--", "curl", "--connect-timeout", "1", "--max-time", "5", address).Output() } else { - out, err = oc.AsAdmin().Run("exec").Args(podName, "-n", namespace, "--", "curl", "--connect-timeout", "1", address).Output() + out, err = oc.AsAdmin().Run("exec").Args(podName, "-n", namespace, "--", "curl", "--connect-timeout", "1", "--max-time", "5", address).Output() } return err - }, "30s", "1s").Should(o.HaveOccurred(), "cmd output: %s", out) + }, "30s", "5s").Should(o.HaveOccurred(), "cmd output: %s", out) } func mustParseIPAndMask(in string) *net.IPNet {