Browse Source

Fix flaky test, TestDockerNetworkHostModeUngracefulDaemonRestart

Fixes #19368 by waiting until all container statuses are running
before killing the daemon

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Christopher Jones 9 years ago
parent
commit
045aee2002
1 changed files with 4 additions and 0 deletions
  1. 4 0
      integration-cli/docker_cli_network_unix_test.go

+ 4 - 0
integration-cli/docker_cli_network_unix_test.go

@@ -1012,6 +1012,10 @@ func (s *DockerNetworkSuite) TestDockerNetworkHostModeUngracefulDaemonRestart(c
 		cName := fmt.Sprintf("hostc-%d", i)
 		out, err := s.d.Cmd("run", "-d", "--name", cName, "--net=host", "--restart=always", "busybox", "top")
 		c.Assert(err, checker.IsNil, check.Commentf(out))
+
+		// verfiy container has finished starting before killing daemon
+		err = s.d.waitRun(fmt.Sprintf("hostc-%d", i))
+		c.Assert(err, checker.IsNil)
 	}
 
 	// Kill daemon ungracefully and restart