xfer: fix a simple goroutine leak in unit test

Signed-off-by: Ziheng Liu <lzhfromustc@gmail.com>
This commit is contained in:
Ziheng Liu 2022-01-07 20:28:18 -08:00
parent ea96e160e4
commit 3dda7311cd
1 changed files with 1 additions and 0 deletions

View File

@ -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")
}