Explorar o código

Merge pull request #43132 from lzhfromustc/patch_1_7

test: fix a simple goroutine leak in distribution/xfer
Sebastiaan van Stijn %!s(int64=3) %!d(string=hai) anos
pai
achega
eddbd6ff1e
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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)
 	_, _, err := ldm.Download(ctx, *image.NewRootFS(), runtime.GOOS, descriptors, progress.ChanOutput(progressChan))
 	if err != context.Canceled {
+		close(progressChan)
 		t.Fatal("expected download to be cancelled")
 	}