瀏覽代碼

Avoid TestExecWindowsOpenHandles timing out

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 8 年之前
父節點
當前提交
f8821202c6
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      integration-cli/docker_cli_exec_test.go

+ 8 - 3
integration-cli/docker_cli_exec_test.go

@@ -541,6 +541,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
 		exec <- true
 		exec <- true
 	}()
 	}()
 
 
+	count := 0
 	for {
 	for {
 		top := make(chan string)
 		top := make(chan string)
 		var out string
 		var out string
@@ -551,7 +552,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
 
 
 		select {
 		select {
 		case <-time.After(time.Second * 5):
 		case <-time.After(time.Second * 5):
-			c.Error("timed out waiting for top while exec is exiting")
+			c.Fatal("timed out waiting for top while exec is exiting")
 		case out = <-top:
 		case out = <-top:
 			break
 			break
 		}
 		}
@@ -560,6 +561,10 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
 			// The initial exec process (cmd.exe) has exited, and both sleeps are currently running
 			// The initial exec process (cmd.exe) has exited, and both sleeps are currently running
 			break
 			break
 		}
 		}
+		count++
+		if count >= 30 {
+			c.Fatal("too many retries")
+		}
 		time.Sleep(1 * time.Second)
 		time.Sleep(1 * time.Second)
 	}
 	}
 
 
@@ -571,7 +576,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
 
 
 	select {
 	select {
 	case <-time.After(time.Second * 5):
 	case <-time.After(time.Second * 5):
-		c.Error("timed out waiting for inspect while exec is exiting")
+		c.Fatal("timed out waiting for inspect while exec is exiting")
 	case <-inspect:
 	case <-inspect:
 		break
 		break
 	}
 	}
@@ -583,7 +588,7 @@ func (s *DockerSuite) TestExecWindowsOpenHandles(c *check.C) {
 	// The exec should exit when the background sleep exits
 	// The exec should exit when the background sleep exits
 	select {
 	select {
 	case <-time.After(time.Second * 15):
 	case <-time.After(time.Second * 15):
-		c.Error("timed out waiting for async exec to exit")
+		c.Fatal("timed out waiting for async exec to exit")
 	case <-exec:
 	case <-exec:
 		// Ensure the background sleep has actually exited
 		// Ensure the background sleep has actually exited
 		out, _ := dockerCmd(c, "top", "test")
 		out, _ := dockerCmd(c, "top", "test")