Browse code

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 authored on 2016/02/12 06:30:35
Showing 1 changed files
... ...
@@ -1012,6 +1012,10 @@ func (s *DockerNetworkSuite) TestDockerNetworkHostModeUngracefulDaemonRestart(c
1012 1012
 		cName := fmt.Sprintf("hostc-%d", i)
1013 1013
 		out, err := s.d.Cmd("run", "-d", "--name", cName, "--net=host", "--restart=always", "busybox", "top")
1014 1014
 		c.Assert(err, checker.IsNil, check.Commentf(out))
1015
+
1016
+		// verfiy container has finished starting before killing daemon
1017
+		err = s.d.waitRun(fmt.Sprintf("hostc-%d", i))
1018
+		c.Assert(err, checker.IsNil)
1015 1019
 	}
1016 1020
 
1017 1021
 	// Kill daemon ungracefully and restart