Merge pull request #40157 from lzhfromustc/GL_2test

awslogs & archive: prevent 2 goroutine leaks in test functions
This commit is contained in:
Tõnis Tiigi 2019-10-31 11:24:41 -07:00 committed by GitHub
commit 64fd3dc0d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -345,7 +345,7 @@ func TestLogNonBlockingBufferFull(t *testing.T) {
logNonBlocking: true, logNonBlocking: true,
} }
stream.messages <- &logger.Message{} stream.messages <- &logger.Message{}
errorCh := make(chan error) errorCh := make(chan error, 1)
started := make(chan bool) started := make(chan bool)
go func() { go func() {
started <- true started <- true

View File

@ -217,7 +217,7 @@ func TestCmdStreamLargeStderr(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("Failed to start command: %s", err) t.Fatalf("Failed to start command: %s", err)
} }
errCh := make(chan error) errCh := make(chan error, 1)
go func() { go func() {
_, err := io.Copy(ioutil.Discard, out) _, err := io.Copy(ioutil.Discard, out)
errCh <- err errCh <- err