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,
}
stream.messages <- &logger.Message{}
errorCh := make(chan error)
errorCh := make(chan error, 1)
started := make(chan bool)
go func() {
started <- true

View file

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