From 7c7d003e5c0d6a8329e7a2a75909469e37ddae09 Mon Sep 17 00:00:00 2001 From: Antonio Ojea Date: Wed, 7 Apr 2021 20:07:18 +0200 Subject: [PATCH] e2e test with hostNetwork pods can't run in parallel the tests with pods using hostNetwork need to bind pods for the test. Since they use hostNetwork the ports are limited, hence, if more than one run in parallel, one is going to fail because will not be able to get the port. --- test/e2e/network/networking.go | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/test/e2e/network/networking.go b/test/e2e/network/networking.go index db109100e57..e976448b4c7 100644 --- a/test/e2e/network/networking.go +++ b/test/e2e/network/networking.go @@ -468,21 +468,6 @@ var _ = common.SIGDescribe("Networking", func() { } }) - ginkgo.It("should function for pod-Service(hostNetwork): udp", func() { - config := e2enetwork.NewNetworkingTestConfig(f, e2enetwork.EndpointsUseHostNetwork) - ginkgo.By(fmt.Sprintf("dialing(udp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, e2enetwork.ClusterUDPPort)) - err := config.DialFromTestContainer("udp", config.ClusterIP, e2enetwork.ClusterUDPPort, config.MaxTries, 0, config.EndpointHostnames()) - if err != nil { - framework.Failf("failed dialing endpoint, %v", err) - } - - ginkgo.By(fmt.Sprintf("dialing(udp) %v --> %v:%v (nodeIP)", config.TestContainerPod.Name, config.NodeIP, config.NodeUDPPort)) - err = config.DialFromTestContainer("udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames()) - if err != nil { - framework.Failf("failed dialing endpoint, %v", err) - } - }) - // if the endpoints pods use hostNetwork, several tests can't run in parallel // because the pods will try to acquire the same port in the host. // We run the test in serial, to avoid port conflicts. @@ -502,6 +487,20 @@ var _ = common.SIGDescribe("Networking", func() { framework.Failf("failed dialing endpoint, %v", err) } + ginkgo.By("pod-Service(hostNetwork): udp") + + ginkgo.By(fmt.Sprintf("dialing(udp) %v --> %v:%v (config.clusterIP)", config.TestContainerPod.Name, config.ClusterIP, e2enetwork.ClusterUDPPort)) + err = config.DialFromTestContainer("udp", config.ClusterIP, e2enetwork.ClusterUDPPort, config.MaxTries, 0, config.EndpointHostnames()) + if err != nil { + framework.Failf("failed dialing endpoint, %v", err) + } + + ginkgo.By(fmt.Sprintf("dialing(udp) %v --> %v:%v (nodeIP)", config.TestContainerPod.Name, config.NodeIP, config.NodeUDPPort)) + err = config.DialFromTestContainer("udp", config.NodeIP, config.NodeUDPPort, config.MaxTries, 0, config.EndpointHostnames()) + if err != nil { + framework.Failf("failed dialing endpoint, %v", err) + } + ginkgo.By("node-Service(hostNetwork): http") ginkgo.By(fmt.Sprintf("dialing(http) %v (node) --> %v:%v (config.clusterIP)", config.NodeIP, config.ClusterIP, e2enetwork.ClusterHTTPPort))