mirror of https://github.com/k3s-io/k3s
Poll much more frequently, remove wait for pods to be ready, and do one final check
parent
4e5e1b8ac5
commit
27fb17e785
|
@ -143,6 +143,8 @@ func pollInternal(wait WaitFunc, condition ConditionFunc) error {
|
||||||
return WaitFor(wait, condition, done)
|
return WaitFor(wait, condition, done)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PollImmediate is identical to Poll, except that it performs the first check
|
||||||
|
// immediately, not waiting interval beforehand.
|
||||||
func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error {
|
func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) error {
|
||||||
return pollImmediateInternal(poller(interval, timeout), condition)
|
return pollImmediateInternal(poller(interval, timeout), condition)
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,25 +304,17 @@ func testService(f *framework.Framework, sem *chaosmonkey.Semaphore, testDuringU
|
||||||
// Continuous validation
|
// Continuous validation
|
||||||
wait.Until(func() {
|
wait.Until(func() {
|
||||||
By("hitting the pod through the service's LoadBalancer")
|
By("hitting the pod through the service's LoadBalancer")
|
||||||
// TODO this is way too long of a timeout; make it shorter since we've already
|
jig.TestReachableHTTP(tcpIngressIP, svcPort, framework.Poll)
|
||||||
// validated it's working.
|
}, framework.Poll, sem.StopCh)
|
||||||
jig.TestReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeoutDefault)
|
|
||||||
}, 3*time.Second, sem.StopCh)
|
|
||||||
} else {
|
} else {
|
||||||
// Block until chaosmonkey is done
|
// Block until chaosmonkey is done
|
||||||
By("waiting for upgrade to finish without checking if service remains up")
|
By("waiting for upgrade to finish without checking if service remains up")
|
||||||
<-sem.StopCh
|
<-sem.StopCh
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(ihmccreery) We maybe shouldn't have to wait for the pods to be running again. I
|
// Sanity check and hit it once more
|
||||||
// pulled this over from the NodeUpgrade test, but I'm not sure what the need for it there
|
By("hitting the pod through the service's LoadBalancer")
|
||||||
// was.
|
jig.TestReachableHTTP(tcpIngressIP, svcPort, loadBalancerLagTimeoutDefault)
|
||||||
//
|
|
||||||
// Also 1 is a magic number from newRCTemplate.
|
|
||||||
framework.Logf("Waiting up to %v for all pods to be running and ready after the upgrade", restartPodReadyAgainTimeout)
|
|
||||||
framework.ExpectNoError(framework.WaitForPodsRunningReady(f.Namespace.Name, 1, restartPodReadyAgainTimeout))
|
|
||||||
|
|
||||||
// Validation
|
|
||||||
jig.SanityCheckService(tcpService, api.ServiceTypeLoadBalancer)
|
jig.SanityCheckService(tcpService, api.ServiceTypeLoadBalancer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue