From 5561056d7471031540c8399a8885b9013c54b097 Mon Sep 17 00:00:00 2001 From: Sylwester Brzeczkowski Date: Thu, 9 Jun 2016 12:14:46 +0200 Subject: [PATCH] Parallel waiting for pods in e2e --- test/e2e/framework/util.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 3228745e283..6d6b7de21d3 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -1599,13 +1599,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 }