From e89f3375f2d9df0b72a7f0c6e086af8efa2a96ed Mon Sep 17 00:00:00 2001 From: saadali Date: Tue, 7 Jul 2015 15:52:01 -0700 Subject: [PATCH] Fix "Docker Containers should be able to override the image's default commmand" tests --- test/e2e/util.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/e2e/util.go b/test/e2e/util.go index 71a66145dfc..31aab8eefcb 100644 --- a/test/e2e/util.go +++ b/test/e2e/util.go @@ -895,6 +895,7 @@ func testContainerOutputInNamespace(scenarioName string, c *client.Client, pod * // Sometimes the actual containers take a second to get started, try to get logs for 60s for time.Now().Sub(start) < (60 * time.Second) { + err = nil logs, err = c.Get(). Prefix("proxy"). Resource("nodes"). @@ -902,14 +903,17 @@ func testContainerOutputInNamespace(scenarioName string, c *client.Client, pod * Suffix("containerLogs", ns, podStatus.Name, containerName). Do(). Raw() - fmt.Sprintf("pod logs:%v\n", string(logs)) - By(fmt.Sprintf("pod logs:%v\n", string(logs))) - if strings.Contains(string(logs), "Internal Error") { - By(fmt.Sprintf("Failed to get logs from node %q pod %q container %q: %v", - podStatus.Spec.NodeName, podStatus.Name, containerName, string(logs))) + if err == nil && strings.Contains(string(logs), "Internal Error") { + err = fmt.Errorf("Fetched log contains \"Internal Error\": %q.", string(logs)) + } + if err != nil { + By(fmt.Sprintf("Warning: Failed to get logs from node %q pod %q container %q. %v", + podStatus.Spec.NodeName, podStatus.Name, containerName, err)) time.Sleep(5 * time.Second) continue + } + By(fmt.Sprintf("Succesfully fetched pod logs:%v\n", string(logs))) break }