mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
7b366b1f01
commit
eb97163348
1 changed files with 10 additions and 8 deletions
|
@ -10,11 +10,19 @@ import (
|
||||||
|
|
||||||
func TestMultipleAttachRestart(t *testing.T) {
|
func TestMultipleAttachRestart(t *testing.T) {
|
||||||
cmd := exec.Command(dockerBinary, "run", "--name", "attacher", "-d", "busybox",
|
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 := sync.WaitGroup{}
|
||||||
group.Add(4)
|
group.Add(4)
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
cmd = exec.Command(dockerBinary, "kill", "attacher")
|
||||||
|
if _, err := runCommand(cmd); err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
deleteAllContainers()
|
||||||
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer group.Done()
|
defer group.Done()
|
||||||
out, _, err := runCommandWithOutput(cmd)
|
out, _, err := runCommandWithOutput(cmd)
|
||||||
|
@ -41,11 +49,5 @@ func TestMultipleAttachRestart(t *testing.T) {
|
||||||
|
|
||||||
group.Wait()
|
group.Wait()
|
||||||
|
|
||||||
cmd = exec.Command(dockerBinary, "kill", "attacher")
|
logDone("attach - multiple attach")
|
||||||
if _, err := runCommand(cmd); err != nil {
|
|
||||||
t.Fatal(err)
|
|
||||||
}
|
|
||||||
deleteAllContainers()
|
|
||||||
|
|
||||||
logDone("run - multiple attach")
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue