From 3dda7311cd645386fbc46078c0c7cfff3d9da4e8 Mon Sep 17 00:00:00 2001
From: Ziheng Liu <lzhfromustc@gmail.com>
Date: Fri, 7 Jan 2022 20:28:18 -0800
Subject: [PATCH] xfer: fix a simple goroutine leak in unit test

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
---
 distribution/xfer/download_test.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/distribution/xfer/download_test.go b/distribution/xfer/download_test.go
index fbf7f541af..9e51c6306f 100644
--- a/distribution/xfer/download_test.go
+++ b/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")
 	}