mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
e2e: network tiers should retry on 404 errors
The feature is still Alpha and at times, the IP address previously used by the load balancer in the test will not completely freed even after the load balancer is long gone. In this case, the test URL with the IP would return a 404 response. Tolerate this error and retry until the new load balancer is fully established.
This commit is contained in:
@@ -832,7 +832,13 @@ func (j *ServiceTestJig) LaunchEchoserverPodOnNode(f *Framework, nodeName, podNa
|
||||
}
|
||||
|
||||
func (j *ServiceTestJig) TestReachableHTTP(host string, port int, timeout time.Duration) {
|
||||
if err := wait.PollImmediate(Poll, timeout, func() (bool, error) { return TestReachableHTTP(host, port, "/echo?msg=hello", "hello") }); err != nil {
|
||||
j.TestReachableHTTPWithRetriableErrorCodes(host, port, []int{}, timeout)
|
||||
}
|
||||
|
||||
func (j *ServiceTestJig) TestReachableHTTPWithRetriableErrorCodes(host string, port int, retriableErrCodes []int, timeout time.Duration) {
|
||||
if err := wait.PollImmediate(Poll, timeout, func() (bool, error) {
|
||||
return TestReachableHTTPWithRetriableErrorCodes(host, port, "/echo?msg=hello", "hello", retriableErrCodes)
|
||||
}); err != nil {
|
||||
Failf("Could not reach HTTP service through %v:%v after %v: %v", host, port, timeout, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user