Merge pull request #124161 from aojea/lb_timeout

fix e2e loadbalancer test timeouts and assumptions
This commit is contained in:
Kubernetes Prow Robot 2024-04-23 09:29:16 -07:00 committed by GitHub
commit 7fa3098a9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 19 deletions

View File

@ -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.

View File

@ -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