From 27e20e226eb9494502dc406d4ab6ec91f071dcf2 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 2 Jun 2021 13:04:13 +0200 Subject: [PATCH 1/4] e2e lb use same variable for endpoint path --- test/e2e/network/loadbalancer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/network/loadbalancer.go b/test/e2e/network/loadbalancer.go index a5f4b0d595c..5f668ea092a 100644 --- a/test/e2e/network/loadbalancer.go +++ b/test/e2e/network/loadbalancer.go @@ -1197,7 +1197,7 @@ var _ = common.SIGDescribe("ESIPP [Slow]", func() { ginkgo.By(fmt.Sprintf("checking source ip is NOT preserved through loadbalancer %v", ingressIP)) var clientIP string pollErr := wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) { - clientIP, err := GetHTTPContent(ingressIP, svcTCPPort, e2eservice.KubeProxyLagTimeout, "/clientip") + clientIP, err := GetHTTPContent(ingressIP, svcTCPPort, e2eservice.KubeProxyLagTimeout, path) if err != nil { return false, nil } From 21073e3b347a119f30f856e3c0cc224310e67141 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 2 Jun 2021 22:38:08 +0200 Subject: [PATCH 2/4] loadbalancer outer poll loops should have a longer timeout that inner loop --- test/e2e/network/loadbalancer.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/network/loadbalancer.go b/test/e2e/network/loadbalancer.go index 5f668ea092a..60867a55478 100644 --- a/test/e2e/network/loadbalancer.go +++ b/test/e2e/network/loadbalancer.go @@ -1196,7 +1196,7 @@ var _ = common.SIGDescribe("ESIPP [Slow]", func() { // Poll till kube-proxy re-adds the MASQUERADE rule on the node. ginkgo.By(fmt.Sprintf("checking source ip is NOT preserved through loadbalancer %v", ingressIP)) var clientIP string - pollErr := wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) { + pollErr := wait.PollImmediate(framework.Poll, 3*e2eservice.KubeProxyLagTimeout, func() (bool, error) { clientIP, err := GetHTTPContent(ingressIP, svcTCPPort, e2eservice.KubeProxyLagTimeout, path) if err != nil { return false, nil @@ -1223,7 +1223,8 @@ var _ = common.SIGDescribe("ESIPP [Slow]", func() { svc.Spec.HealthCheckNodePort = int32(healthCheckNodePort) }) framework.ExpectNoError(err) - pollErr = wait.PollImmediate(framework.Poll, e2eservice.KubeProxyLagTimeout, func() (bool, error) { + loadBalancerPropagationTimeout := e2eservice.GetServiceLoadBalancerPropagationTimeout(cs) + pollErr = wait.PollImmediate(framework.PollShortTimeout, loadBalancerPropagationTimeout, func() (bool, error) { clientIP, err := GetHTTPContent(ingressIP, svcTCPPort, e2eservice.KubeProxyLagTimeout, path) if err != nil { return false, nil From 8e2eeffa792109356462437c4ad42e69cb3923bd Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 2 Jun 2021 13:31:12 +0200 Subject: [PATCH 3/4] PokeHTTP default timeout to avoid hanging connections --- test/e2e/framework/network/utils.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/network/utils.go b/test/e2e/framework/network/utils.go index 082e7e5f0d8..0e19328103d 100644 --- a/test/e2e/framework/network/utils.go +++ b/test/e2e/framework/network/utils.go @@ -900,8 +900,8 @@ func (config *NetworkingTestConfig) getServiceClient() coreclientset.ServiceInte // HTTPPokeParams is a struct for HTTP poke parameters. type HTTPPokeParams struct { - Timeout time.Duration - ExpectCode int // default = 200 + Timeout time.Duration // default = 10 secs + ExpectCode int // default = 200 BodyContains string RetriableCodes []int EnableHTTPS bool @@ -981,6 +981,10 @@ func PokeHTTP(host string, port int, path string, params *HTTPPokeParams) HTTPPo params.ExpectCode = http.StatusOK } + if params.Timeout == 0 { + params.Timeout = 10 * time.Second + } + framework.Logf("Poking %q", url) resp, err := httpGetNoConnectionPoolTimeout(url, params.Timeout) From b8edcd3bb3389a436b30a6d132948d9dc603f2f6 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 2 Jun 2021 18:26:49 +0200 Subject: [PATCH 4/4] add loadbalancer name to ESIPP tests so regex pick them --- test/e2e/network/loadbalancer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/network/loadbalancer.go b/test/e2e/network/loadbalancer.go index 60867a55478..7fca3460250 100644 --- a/test/e2e/network/loadbalancer.go +++ b/test/e2e/network/loadbalancer.go @@ -848,7 +848,7 @@ var _ = common.SIGDescribe("LoadBalancers", func() { }) }) -var _ = common.SIGDescribe("ESIPP [Slow]", func() { +var _ = common.SIGDescribe("LoadBalancers ESIPP [Slow]", func() { f := framework.NewDefaultFramework("esipp") var loadBalancerCreateTimeout time.Duration