diff --git a/test/e2e/network/loadbalancer.go b/test/e2e/network/loadbalancer.go index 379c4858852..83192f672bc 100644 --- a/test/e2e/network/loadbalancer.go +++ b/test/e2e/network/loadbalancer.go @@ -299,21 +299,21 @@ var _ = common.SIGDescribe("LoadBalancers", func() { framework.Logf("service port TCP: %d", svcPort) ginkgo.By("hitting the TCP service's LoadBalancer") - e2eservice.TestReachableHTTP(ctx, tcpIngressIP, svcPort, loadBalancerCreateTimeout) + e2eservice.TestReachableHTTP(ctx, tcpIngressIP, svcPort, loadBalancerLagTimeout) ginkgo.By("Scaling the pods to 0") err = tcpJig.Scale(ctx, 0) framework.ExpectNoError(err) - ginkgo.By("looking for ICMP REJECT on the TCP service's LoadBalancer") - testRejectedHTTP(tcpIngressIP, svcPort, loadBalancerCreateTimeout) + ginkgo.By("hitting the TCP service's LoadBalancer with no backends, no answer expected") + testNotReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeout) ginkgo.By("Scaling the pods to 1") err = tcpJig.Scale(ctx, 1) framework.ExpectNoError(err) ginkgo.By("hitting the TCP service's LoadBalancer") - e2eservice.TestReachableHTTP(ctx, tcpIngressIP, svcPort, loadBalancerCreateTimeout) + e2eservice.TestReachableHTTP(ctx, tcpIngressIP, svcPort, loadBalancerLagTimeout) // Change the services back to ClusterIP. diff --git a/test/e2e/network/service.go b/test/e2e/network/service.go index 7b4e97a626b..462975a1419 100644 --- a/test/e2e/network/service.go +++ b/test/e2e/network/service.go @@ -444,21 +444,6 @@ func testNotReachableHTTP(host string, port int, timeout time.Duration) { } } -// testRejectedHTTP tests that the given host rejects a HTTP request on the given port. -func testRejectedHTTP(host string, port int, timeout time.Duration) { - pollfn := func() (bool, error) { - result := e2enetwork.PokeHTTP(host, port, "/", nil) - if result.Status == e2enetwork.HTTPRefused { - return true, nil - } - return false, nil // caller can retry - } - - if err := wait.PollImmediate(framework.Poll, timeout, pollfn); err != nil { - framework.Failf("HTTP service %v:%v not rejected: %v", host, port, err) - } -} - // UDPPokeParams is a struct for UDP poke parameters. type UDPPokeParams struct { Timeout time.Duration