mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
pkg/podvolume/backupper_test.go:597:14: the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user