Commit e89f3375 authored by saadali's avatar saadali

Fix "Docker Containers should be able to override the image's default commmand" tests

parent 0d2b8dbd
...@@ -895,6 +895,7 @@ func testContainerOutputInNamespace(scenarioName string, c *client.Client, pod * ...@@ -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 // Sometimes the actual containers take a second to get started, try to get logs for 60s
for time.Now().Sub(start) < (60 * time.Second) { for time.Now().Sub(start) < (60 * time.Second) {
err = nil
logs, err = c.Get(). logs, err = c.Get().
Prefix("proxy"). Prefix("proxy").
Resource("nodes"). Resource("nodes").
...@@ -902,14 +903,17 @@ func testContainerOutputInNamespace(scenarioName string, c *client.Client, pod * ...@@ -902,14 +903,17 @@ func testContainerOutputInNamespace(scenarioName string, c *client.Client, pod *
Suffix("containerLogs", ns, podStatus.Name, containerName). Suffix("containerLogs", ns, podStatus.Name, containerName).
Do(). Do().
Raw() Raw()
fmt.Sprintf("pod logs:%v\n", string(logs)) if err == nil && strings.Contains(string(logs), "Internal Error") {
By(fmt.Sprintf("pod logs:%v\n", string(logs))) err = fmt.Errorf("Fetched log contains \"Internal Error\": %q.", string(logs))
if strings.Contains(string(logs), "Internal Error") { }
By(fmt.Sprintf("Failed to get logs from node %q pod %q container %q: %v", if err != nil {
podStatus.Spec.NodeName, podStatus.Name, containerName, string(logs))) 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) time.Sleep(5 * time.Second)
continue continue
} }
By(fmt.Sprintf("Succesfully fetched pod logs:%v\n", string(logs)))
break break
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment