mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Test for issue #9699
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
parent
8722b6db4b
commit
eda92e8834
1 changed files with 25 additions and 0 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue