diff --git a/integration-cli/docker_cli_daemon_test.go b/integration-cli/docker_cli_daemon_test.go index a974b6fede..1737f34b4f 100644 --- a/integration-cli/docker_cli_daemon_test.go +++ b/integration-cli/docker_cli_daemon_test.go @@ -49,6 +49,7 @@ import ( func (s *DockerDaemonSuite) TestLegacyDaemonCommand(c *check.C) { cmd := exec.Command(dockerBinary, "daemon", "--storage-driver=vfs", "--debug") err := cmd.Start() + go cmd.Wait() c.Assert(err, checker.IsNil, check.Commentf("could not start daemon using 'docker daemon'")) c.Assert(cmd.Process.Kill(), checker.IsNil) diff --git a/integration-cli/docker_cli_exec_test.go b/integration-cli/docker_cli_exec_test.go index 4442ca2c4c..e915e1e7e4 100644 --- a/integration-cli/docker_cli_exec_test.go +++ b/integration-cli/docker_cli_exec_test.go @@ -229,18 +229,18 @@ func (s *DockerSuite) TestExecStopNotHanging(c *check.C) { testRequires(c, DaemonIsLinux) dockerCmd(c, "run", "-d", "--name", "testing", "busybox", "top") - err := exec.Command(dockerBinary, "exec", "testing", "top").Start() - c.Assert(err, checker.IsNil) + result := icmd.StartCmd(icmd.Command(dockerBinary, "exec", "testing", "top")) + result.Assert(c, icmd.Success) + go icmd.WaitOnCmd(0, result) type dstop struct { - out []byte + out string err error } - ch := make(chan dstop) go func() { - out, err := exec.Command(dockerBinary, "stop", "testing").CombinedOutput() - ch <- dstop{out, err} + result := icmd.RunCommand(dockerBinary, "stop", "testing") + ch <- dstop{result.Combined(), result.Error} close(ch) }() select { diff --git a/integration-cli/docker_cli_logs_test.go b/integration-cli/docker_cli_logs_test.go index 41927a2806..fb99b2807d 100644 --- a/integration-cli/docker_cli_logs_test.go +++ b/integration-cli/docker_cli_logs_test.go @@ -280,6 +280,7 @@ func (s *DockerSuite) TestLogsFollowGoroutinesWithStdout(c *check.C) { r, w := io.Pipe() cmd.Stdout = w c.Assert(cmd.Start(), checker.IsNil) + go cmd.Wait() // Make sure pipe is written to chErr := make(chan error) @@ -305,6 +306,7 @@ func (s *DockerSuite) TestLogsFollowGoroutinesNoOutput(c *check.C) { c.Assert(err, checker.IsNil) cmd := exec.Command(dockerBinary, "logs", "-f", id) c.Assert(cmd.Start(), checker.IsNil) + go cmd.Wait() time.Sleep(200 * time.Millisecond) c.Assert(cmd.Process.Kill(), checker.IsNil) cmd.Wait() diff --git a/integration-cli/docker_cli_pull_test.go b/integration-cli/docker_cli_pull_test.go index 56e518b179..613cdb311f 100644 --- a/integration-cli/docker_cli_pull_test.go +++ b/integration-cli/docker_cli_pull_test.go @@ -244,6 +244,7 @@ func (s *DockerHubPullSuite) TestPullClientDisconnect(c *check.C) { c.Assert(err, checker.IsNil) err = pullCmd.Start() c.Assert(err, checker.IsNil) + go pullCmd.Wait() // Cancel as soon as we get some output. buf := make([]byte, 10) diff --git a/integration-cli/docker_cli_run_unix_test.go b/integration-cli/docker_cli_run_unix_test.go index dd32a72d7c..952cf0a4ac 100644 --- a/integration-cli/docker_cli_run_unix_test.go +++ b/integration-cli/docker_cli_run_unix_test.go @@ -226,6 +226,7 @@ func (s *DockerSuite) TestRunAttachDetachFromInvalidFlag(c *check.C) { if err := cmd.Start(); err != nil { c.Fatal(err) } + go cmd.Wait() bufReader := bufio.NewReader(stdout) out, err := bufReader.ReadString('\n') @@ -424,6 +425,7 @@ func (s *DockerSuite) TestRunAttachInvalidDetachKeySequencePreserved(c *check.C) if err := cmd.Start(); err != nil { c.Fatal(err) } + go cmd.Wait() c.Assert(waitRun(name), check.IsNil) // Invalid escape sequence aba, should print aba in output diff --git a/integration-cli/docker_cli_service_logs_test.go b/integration-cli/docker_cli_service_logs_test.go index b17c9483ac..b3f58271f1 100644 --- a/integration-cli/docker_cli_service_logs_test.go +++ b/integration-cli/docker_cli_service_logs_test.go @@ -172,6 +172,7 @@ func (s *DockerSwarmSuite) TestServiceLogsFollow(c *check.C) { cmd.Stdout = w cmd.Stderr = w c.Assert(cmd.Start(), checker.IsNil) + go cmd.Wait() // Make sure pipe is written to ch := make(chan *logMessage) diff --git a/integration-cli/docker_cli_stats_test.go b/integration-cli/docker_cli_stats_test.go index b83a8d4186..454836367f 100644 --- a/integration-cli/docker_cli_stats_test.go +++ b/integration-cli/docker_cli_stats_test.go @@ -131,6 +131,7 @@ func (s *DockerSuite) TestStatsAllNewContainersAdded(c *check.C) { stdout, err := statsCmd.StdoutPipe() c.Assert(err, check.IsNil) c.Assert(statsCmd.Start(), check.IsNil) + go statsCmd.Wait() defer statsCmd.Process.Kill() go func() {