From 6efe6e1284245e601d90c69ac372673665eefc95 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Sun, 19 Apr 2020 13:52:49 +0200 Subject: [PATCH] e2e TCP Close-wait don't set conn deadline Don't set a connection deadline for reading, because the read operation will fail if no data is reaceived after the deadline, and will not keep the connection in the close_wait status. --- test/e2e/network/kube_proxy.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/e2e/network/kube_proxy.go b/test/e2e/network/kube_proxy.go index 61c0be0ff2a..6101a9e7dab 100644 --- a/test/e2e/network/kube_proxy.go +++ b/test/e2e/network/kube_proxy.go @@ -44,10 +44,9 @@ var kubeProxyE2eImage = imageutils.GetE2EImage(imageutils.Agnhost) var _ = SIGDescribe("Network", func() { const ( - testDaemonHTTPPort = 11301 - testDaemonTCPPort = 11302 - deadlineTimeoutSeconds = 5 - postFinTimeoutSeconds = 15 + testDaemonHTTPPort = 11301 + testDaemonTCPPort = 11302 + postFinTimeoutSeconds = 30 ) fr := framework.NewDefaultFramework("network") @@ -157,7 +156,7 @@ var _ = SIGDescribe("Network", func() { fmt.Sprintf(`{"RemoteAddr":"%v", "PostFinTimeoutSeconds":%v, "TimeoutSeconds":%v, "LeakConnection":true}`, net.JoinHostPort(serverNodeInfo.nodeIP, strconv.Itoa(testDaemonTCPPort)), postFinTimeoutSeconds, - deadlineTimeoutSeconds), + 0), }, }, }, @@ -232,7 +231,7 @@ var _ = SIGDescribe("Network", func() { cmd := fmt.Sprintf("cat /rootfs/proc/net/nf_conntrack "+ "| grep -m 1 'CLOSE_WAIT.*dst=%v.*dport=%v' ", ip, testDaemonTCPPort) - if err := wait.PollImmediate(deadlineTimeoutSeconds, postFinTimeoutSeconds, func() (bool, error) { + if err := wait.PollImmediate(1*time.Second, postFinTimeoutSeconds, func() (bool, error) { result, err := framework.RunHostCmd(fr.Namespace.Name, "e2e-net-exec", cmd) // retry if we can't obtain the conntrack entry if err != nil {