Change:
} for _, test := range tests { <del> nodes := makeNodeList([]string{"1"}) </del> <ins> t.Run(test.name, func(t *testing.T) { nodes := makeNodeList([]string{"1"}) </ins> <del> plugin := st.FakeFilterPlugin{} registerFakeFilterFunc := st.RegisterFilterPlugin( "FakeFilter", func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) { return &plugin, nil }, ) registerPlugins := []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), registerFakeFilterFunc, st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), } fwk, err := st.NewFramework( registerPlugins, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } </del> <ins> plugin := st.FakeFilterPlugin{} registerFakeFilterFunc := st.RegisterFilterPlugin( "FakeFilter", func(_ runtime.Object, fh framework.Handle) (framework.Plugin, error) { return &plugin, nil }, ) registerPlugins := []st.RegisterPluginFunc{ st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New), registerFakeFilterFunc, st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New), } fwk, err := st.NewFramework( registerPlugins, frameworkruntime.WithPodNominator(internalqueue.NewPodNominator()), ) if err != nil { t.Fatal(err) } </ins> <del> scheduler := makeScheduler(nodes) if err := scheduler.cache.UpdateSnapshot(scheduler.nodeInfoSnapshot); err != nil { t.Fatal(err) } fwk.PreemptHandle().AddNominatedPod(&v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: "nominated"}, Spec: v1.PodSpec{Priority: &midPriority}}, "1") </del> <ins> scheduler := makeScheduler(nodes) if err := scheduler.cache.UpdateSnapshot(scheduler.nodeInfoSnapshot); err != nil { t.Fatal(err) } fwk.PreemptHandle().AddNominatedPod(&v1.Pod{ObjectMeta: metav1.ObjectMeta{UID: "nominated"}, Spec: v1.PodSpec{Priority: &midPriority}}, "1") </ins> <del> _, _, err = scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), test.pod) </del> <ins> _, _, err = scheduler.findNodesThatFitPod(context.Background(), fwk, framework.NewCycleState(), test.pod) </ins> <del> if err != nil { t.Errorf("unexpected error: %v", err) } if test.expectedCount != plugin.NumFilterCalled { t.Errorf("predicate was called %d times, expected is %d", plugin.NumFilterCalled, test.expectedCount) } </del> <ins> if err != nil { t.Errorf("unexpected error: %v", err) } if test.expectedCount != plugin.NumFilterCalled { t.Errorf("predicate was called %d times, expected is %d", plugin.NumFilterCalled, test.expectedCount) } }) </ins> } }

Discussion:
<!-- Please only use this template for submitting enhancement requests --What would you like to be : Currently some unit tests in pkg/scheduler is not organized as Use subtests can make it easier to find out which case fails and leverage benefit of parallelism . Why is this needed: Follow Go test practice.
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the label and provide further guidance. The label can be by org members by writing in a comment. <detailsInstructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/remove-kind feature /kind cleanup /sig scheduling /assign