diff --git a/pkg/podvolume/backupper_test.go b/pkg/podvolume/backupper_test.go index 16d4ce286..fe50f9e30 100644 --- a/pkg/podvolume/backupper_test.go +++ b/pkg/podvolume/backupper_test.go @@ -594,7 +594,10 @@ func (l *logHook) Fire(entry *logrus.Entry) error { } func TestWaitAllPodVolumesProcessed(t *testing.T) { - timeoutCtx, _ := context.WithTimeout(context.Background(), 1*time.Second) + timeoutCtx, cancelFunc := context.WithTimeout(context.Background(), 1*time.Second) + defer func() { + cancelFunc() + }() cases := []struct { name string ctx context.Context