Merge pull request #27124 from gitfred/parallel-waiting

Automatic merge from submit-queue

Parallel waiting for pods in e2e

Fixes #27120
This commit is contained in:
k8s-merge-robot 2016-06-30 17:49:49 -07:00 committed by GitHub
commit e2b3aad63a

View File

@ -1648,13 +1648,21 @@ func podsRunning(c *client.Client, pods *api.PodList) []error {
// are running so non-running pods cause a timeout for this test.
By("ensuring each pod is running")
e := []error{}
error_chan := make(chan error)
for _, pod := range pods.Items {
// TODO: make waiting parallel.
err := WaitForPodRunningInNamespace(c, pod.Name, pod.Namespace)
go func(p api.Pod) {
error_chan <- WaitForPodRunningInNamespace(c, p.Name, p.Namespace)
}(pod)
}
for range pods.Items {
err := <-error_chan
if err != nil {
e = append(e, err)
}
}
return e
}