Merge pull request #28212 from soltysh/wait_pod

Automatic merge from submit-queue

Switched watches in tests require ResourceVersion to be passed

For testing the Watches are not sufficient in that it might miss the event of transitioning a Pod from one state to another which might happen before we start Watching events. To remedy this, I'm proposing to switch to Gets to always read the actual state of a Pod.

@smarterclayton this fixes https://github.com/openshift/origin/issues/9192 and hopefully all `gave up waiting for pod...` flakes 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
This commit is contained in:
k8s-merge-robot
2016-07-19 11:28:23 -07:00
committed by GitHub
18 changed files with 128 additions and 110 deletions

View File

@@ -365,24 +365,24 @@ func (f *Framework) WaitForPodTerminated(podName, reason string) error {
// WaitForPodRunning waits for the pod to run in the namespace.
func (f *Framework) WaitForPodRunning(podName string) error {
return WaitForPodRunningInNamespace(f.Client, podName, f.Namespace.Name)
return WaitForPodNameRunningInNamespace(f.Client, podName, f.Namespace.Name)
}
// WaitForPodReady waits for the pod to flip to ready in the namespace.
func (f *Framework) WaitForPodReady(podName string) error {
return waitTimeoutForPodReadyInNamespace(f.Client, podName, f.Namespace.Name, PodStartTimeout)
return waitTimeoutForPodReadyInNamespace(f.Client, podName, f.Namespace.Name, "", PodStartTimeout)
}
// WaitForPodRunningSlow waits for the pod to run in the namespace.
// It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).
func (f *Framework) WaitForPodRunningSlow(podName string) error {
return waitForPodRunningInNamespaceSlow(f.Client, podName, f.Namespace.Name)
return waitForPodRunningInNamespaceSlow(f.Client, podName, f.Namespace.Name, "")
}
// WaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either
// success or failure.
func (f *Framework) WaitForPodNoLongerRunning(podName string) error {
return WaitForPodNoLongerRunningInNamespace(f.Client, podName, f.Namespace.Name)
return WaitForPodNoLongerRunningInNamespace(f.Client, podName, f.Namespace.Name, "")
}
// Runs the given pod and verifies that the output of exact container matches the desired output.