diff options
author | Sebastiaan van Stijn <thaJeztah@users.noreply.github.com> | 2020-05-08 16:00:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 16:00:52 +0200 |
commit | 0fc914de5c9cf13cfa972dbc0ca8034dec7c971d (patch) | |
tree | f865da2ce68f1bf744e8eee60fbfca4a5e65ddee /integration-cli/docker_api_attach_test.go | |
parent | e184eac73a87a55bd77caf988ea9dea4b209e471 (diff) | |
parent | c322af8019dda164bf5af974bf446c4905674e19 (diff) | |
download | docker-0fc914de5c9cf13cfa972dbc0ca8034dec7c971d.tar.gz |
Merge pull request #40595 from sfzhu93/GL_2_25
[integration] add buffer to prevent goroutine leak
Diffstat (limited to 'integration-cli/docker_api_attach_test.go')
-rw-r--r-- | integration-cli/docker_api_attach_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/integration-cli/docker_api_attach_test.go b/integration-cli/docker_api_attach_test.go index 0103ccab80..48bf47e528 100644 --- a/integration-cli/docker_api_attach_test.go +++ b/integration-cli/docker_api_attach_test.go @@ -43,14 +43,14 @@ func (s *DockerSuite) TestGetContainersAttachWebsocket(c *testing.T) { expected := []byte("hello") actual := make([]byte, len(expected)) - outChan := make(chan error) + outChan := make(chan error, 1) go func() { _, err := io.ReadFull(ws, actual) outChan <- err close(outChan) }() - inChan := make(chan error) + inChan := make(chan error, 1) go func() { _, err := ws.Write(expected) inChan <- err @@ -279,7 +279,7 @@ func bodyIsWritable(r *http.Response) bool { // readTimeout read from io.Reader with timeout func readTimeout(r io.Reader, buf []byte, timeout time.Duration) (n int, err error) { - ch := make(chan bool) + ch := make(chan bool, 1) go func() { n, err = io.ReadFull(r, buf) ch <- true |