mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
Merge pull request #124161 from aojea/lb_timeout
fix e2e loadbalancer test timeouts and assumptions
This commit is contained in:
commit
7fa3098a9d
@ -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.
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user