1
0
mirror of https://github.com/moby/moby.git synced 2025-12-18 12:54:26 +03:00

test: add buffer to prevent goroutine leak

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
Ziheng Liu
2020-02-25 17:13:25 -05:00
parent d706420b5d
commit c322af8019
22 changed files with 63 additions and 45 deletions

View File

@@ -26,7 +26,7 @@ func (s *DockerSuite) TestExecInteractiveStdinClose(c *testing.T) {
b := bytes.NewBuffer(nil)
ch := make(chan error)
ch := make(chan error, 1)
go func() { ch <- cmd.Wait() }()
select {
@@ -56,7 +56,7 @@ func (s *DockerSuite) TestExecTTY(c *testing.T) {
_, err = p.Write([]byte("cat /foo && exit\n"))
assert.NilError(c, err)
chErr := make(chan error)
chErr := make(chan error, 1)
go func() {
chErr <- cmd.Wait()
}()