From eb97163348d88954dbacbcbc7eed71efd666dddc Mon Sep 17 00:00:00 2001 From: LK4D4 Date: Fri, 13 Jun 2014 21:32:25 +0400 Subject: [PATCH] Increase time before exit in TestMultipleAttachRestart Sometimes third attacher attaching to already stopped container. Also I've changed prefix to attach and fixed cleanup on Fatal. Docker-DCO-1.1-Signed-off-by: Alexandr Morozov (github: LK4D4) --- integration-cli/docker_cli_attach_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/integration-cli/docker_cli_attach_test.go b/integration-cli/docker_cli_attach_test.go index 1480b807aa..606480c875 100644 --- a/integration-cli/docker_cli_attach_test.go +++ b/integration-cli/docker_cli_attach_test.go @@ -10,11 +10,19 @@ import ( func TestMultipleAttachRestart(t *testing.T) { cmd := exec.Command(dockerBinary, "run", "--name", "attacher", "-d", "busybox", - "/bin/sh", "-c", "sleep 1 && echo hello") + "/bin/sh", "-c", "sleep 2 && echo hello") group := sync.WaitGroup{} group.Add(4) + defer func() { + cmd = exec.Command(dockerBinary, "kill", "attacher") + if _, err := runCommand(cmd); err != nil { + t.Fatal(err) + } + deleteAllContainers() + }() + go func() { defer group.Done() out, _, err := runCommandWithOutput(cmd) @@ -41,11 +49,5 @@ func TestMultipleAttachRestart(t *testing.T) { group.Wait() - cmd = exec.Command(dockerBinary, "kill", "attacher") - if _, err := runCommand(cmd); err != nil { - t.Fatal(err) - } - deleteAllContainers() - - logDone("run - multiple attach") + logDone("attach - multiple attach") }