diff --git a/pkg/descheduler/descheduler_test.go b/pkg/descheduler/descheduler_test.go index 7987fb3cf4..f77b127081 100644 --- a/pkg/descheduler/descheduler_test.go +++ b/pkg/descheduler/descheduler_test.go @@ -150,7 +150,8 @@ func TestRealUtiization(t *testing.T) { internalDeschedulerPolicy := &api.DeschedulerPolicy{} scope := scope{} - ctx, _ := context.WithTimeout(context.Background(), time.Second*10) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() err = v1alpha1.V1alpha1ToInternal(dp, pluginregistry.PluginRegistry, internalDeschedulerPolicy, scope) if err != nil { t.Fatalf("Unable to convert v1alpha1 to v1alpha2: %v", err)