From 6209249976e8234030d651765fb7b8c6a3088160 Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Fri, 17 Apr 2015 00:44:09 +0000 Subject: [PATCH] Use the standard podStartTimeout in services e2e test when waiting for a pod to be reachable behind an external load balancer. I observed occasional timeouts when testing locally, and upon investigation of one particular instance, found that it was just because the pod wasn't up and running yet. I've changed the test to wait as long as all other tests do. Also fix an unrelated error message. --- test/e2e/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/service.go b/test/e2e/service.go index 99bbae0ced2..e07497339a3 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -330,7 +330,7 @@ var _ = Describe("Services", func() { By("hitting the pod through the service's external load balancer") var resp *http.Response - for t := time.Now(); time.Since(t) < time.Minute; time.Sleep(5 * time.Second) { + for t := time.Now(); time.Since(t) < podStartTimeout; time.Sleep(5 * time.Second) { resp, err = http.Get(fmt.Sprintf("http://%s:%d", ip, port)) if err == nil { break @@ -409,7 +409,7 @@ func waitForPublicIPs(c *client.Client, serviceName, namespace string) (*api.Ser } Logf("Waiting for service %s in namespace %s to have a public IP (%v)", serviceName, namespace, time.Since(start)) } - return service, fmt.Errorf("service %s in namespace %s doesn't have a public IP after %.2f seconds", serviceName, namespace, podStartTimeout.Seconds()) + return service, fmt.Errorf("service %s in namespace %s doesn't have a public IP after %.2f seconds", serviceName, namespace, timeout.Seconds()) } func validateUniqueOrFail(s []string) {