Browse Source

Merge pull request #14722 from duglin/FixInspectExecIDTest

Move inspect into the loop on InspectExecID test
Alexander Morozov 10 năm trước cách đây
mục cha
commit
a0a0b8499e
1 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 6 6
      integration-cli/docker_cli_exec_test.go

+ 6 - 6
integration-cli/docker_cli_exec_test.go

@@ -436,15 +436,15 @@ func (s *DockerSuite) TestInspectExecID(c *check.C) {
 		c.Fatalf("failed to start the exec cmd: %q", err)
 	}
 
-	// Since its still running we should see the exec as part of the container
-	out, err = inspectField(id, "ExecIDs")
-	if err != nil {
-		c.Fatalf("failed to inspect container: %s, %v", out, err)
-	}
-
 	// Give the exec 10 chances/seconds to start then give up and stop the test
 	tries := 10
 	for i := 0; i < tries; i++ {
+		// Since its still running we should see exec as part of the container
+		out, err = inspectField(id, "ExecIDs")
+		if err != nil {
+			c.Fatalf("failed to inspect container: %s, %v", out, err)
+		}
+
 		out = strings.TrimSuffix(out, "\n")
 		if out != "[]" && out != "<no value>" {
 			break