Pārlūkot izejas kodu

xfer: fix a simple goroutine leak in unit test

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
Ziheng Liu 3 gadi atpakaļ
vecāks
revīzija
3dda7311cd
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      distribution/xfer/download_test.go

+ 1 - 0
distribution/xfer/download_test.go

@@ -350,6 +350,7 @@ func TestCancelledDownload(t *testing.T) {
 	descriptors := downloadDescriptors(nil)
 	descriptors := downloadDescriptors(nil)
 	_, _, err := ldm.Download(ctx, *image.NewRootFS(), runtime.GOOS, descriptors, progress.ChanOutput(progressChan))
 	_, _, err := ldm.Download(ctx, *image.NewRootFS(), runtime.GOOS, descriptors, progress.ChanOutput(progressChan))
 	if err != context.Canceled {
 	if err != context.Canceled {
+		close(progressChan)
 		t.Fatal("expected download to be cancelled")
 		t.Fatal("expected download to be cancelled")
 	}
 	}