Skip to content

Commit

Permalink
Test for issue moby#9699
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandr Morozov <[email protected]>
  • Loading branch information
LK4D4 committed Dec 27, 2014
1 parent 8722b6d commit eda92e8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions integration-cli/docker_cli_exec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,28 @@ func TestExecParseError(t *testing.T) {
}
logDone("exec - error on parseExec should return usage")
}

func TestExecStopNotHanging(t *testing.T) {
defer deleteAllContainers()
if out, err := exec.Command(dockerBinary, "run", "-d", "--name", "testing", "busybox", "top").CombinedOutput(); err != nil {
t.Fatal(out, err)
}

if err := exec.Command(dockerBinary, "exec", "testing", "top").Start(); err != nil {
t.Fatal(err)
}

wait := make(chan struct{})
go func() {
if out, err := exec.Command(dockerBinary, "stop", "testing").CombinedOutput(); err != nil {
t.Fatal(out, err)
}
close(wait)
}()
select {
case <-time.After(3 * time.Second):
t.Fatal("Container stop timed out")
case <-wait:
}
logDone("exec - container with exec not hanging on stop")
}

0 comments on commit eda92e8

Please sign in to comment.