test: amend some misuse of channel in test functions

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
Ziheng Liu
2020-02-14 21:30:18 -05:00
parent d8772509d1
commit d90b05d661
2 changed files with 2 additions and 3 deletions

View File

@@ -407,12 +407,11 @@ func TestMaxDownloadAttempts(t *testing.T) {
})
progressChan := make(chan progress.Progress)
progressDone := make(chan struct{})
defer close(progressChan)
go func() {
for range progressChan {
}
close(progressDone)
}()
var currentDownloads int32

View File

@@ -2125,7 +2125,7 @@ func (s *DockerDaemonSuite) TestDaemonStartWithoutColors(c *testing.T) {
infoLog := "\x1b[36mINFO\x1b"
b := bytes.NewBuffer(nil)
done := make(chan bool)
done := make(chan bool, 1)
p, tty, err := pty.Open()
assert.NilError(c, err)