From 326c84a1515256b3896773a6c8d93b2b8669a9e8 Mon Sep 17 00:00:00 2001 From: Nadia Pinaeva Date: Mon, 2 Dec 2024 11:55:05 +0100 Subject: [PATCH] [e2e, service] Add total timeout for affinity check curl command. Not setting a total timeout for curl may result in hanging command if the connection succeeded, but the data transfer did not. Signed-off-by: Nadia Pinaeva --- test/e2e/network/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go index e9fd2c35879..40c4d9d20a1 100644 --- a/test/e2e/network/service.go +++ b/test/e2e/network/service.go @@ -142,7 +142,7 @@ func affinityCheckFromPod(execPod *v1.Pod, serviceIP string, servicePort int) (t interval := 2 * AffinityConfirmCount * time.Second serviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort)) - curl := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort) + curl := fmt.Sprintf(`curl -q -s --connect-timeout 2 --max-time 60 http://%s/`, serviceIPPort) cmd := fmt.Sprintf("for i in $(seq 0 %d); do echo; %s ; done", AffinityConfirmCount, curl) getHosts := func() []string { stdout, err := e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)