From c09765ac431a85f9ad231c52cbe562bb6f0b0b06 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Tue, 21 Apr 2015 21:58:16 -0700 Subject: [PATCH] Wait until all pushes are done in TestPushInterrupt Background pushes affects other tests Signed-off-by: Alexander Morozov --- integration-cli/docker_cli_push_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/integration-cli/docker_cli_push_test.go b/integration-cli/docker_cli_push_test.go index 5c74fe8dcf..ebf08bae8b 100644 --- a/integration-cli/docker_cli_push_test.go +++ b/integration-cli/docker_cli_push_test.go @@ -92,11 +92,9 @@ func (s *DockerSuite) TestPushMultipleTags(c *check.C) { func (s *DockerSuite) TestPushInterrupt(c *check.C) { defer setupRegistry(c)() - repoName := fmt.Sprintf("%v/dockercli/busybox", privateRegistryURL) // tag the image to upload it tot he private registry - tagCmd := exec.Command(dockerBinary, "tag", "busybox", repoName) - if out, _, err := runCommandWithOutput(tagCmd); err != nil { + if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "tag", "busybox", repoName)); err != nil { c.Fatalf("image tagging failed: %s, %v", out, err) } defer deleteImages(repoName) @@ -111,14 +109,17 @@ func (s *DockerSuite) TestPushInterrupt(c *check.C) { if err := pushCmd.Process.Kill(); err != nil { c.Fatalf("Failed to kill push process: %v", err) } - // Try agin - pushCmd = exec.Command(dockerBinary, "push", repoName) - if out, err := pushCmd.CombinedOutput(); err == nil { + if out, _, err := runCommandWithOutput(exec.Command(dockerBinary, "push", repoName)); err == nil { str := string(out) if !strings.Contains(str, "already in progress") { c.Fatalf("Push should be continued on daemon side, but seems ok: %v, %s", err, out) } } + // now wait until all this pushes will complete + // if it will fail with timeout - this is some error, so no logic about it + // here + for exec.Command(dockerBinary, "push", repoName).Run() != nil { + } } func (s *DockerSuite) TestPushEmptyLayer(c *check.C) {