@@ -935,6 +935,7 @@ func TestSchedulerNoPhantomPodAfterDelete(t *testing.T) {
935935node .Name : framework .NewStatus (framework .Unschedulable , nodeports .ErrReason ).WithPlugin (nodeports .Name ),
936936},
937937UnschedulablePlugins : sets .New (nodeports .Name ),
938+ EvaluatedNodes : 1 ,
938939},
939940}
940941if ! reflect .DeepEqual (expectErr , err ) {
@@ -1042,6 +1043,7 @@ func TestSchedulerFailedSchedulingReasons(t *testing.T) {
10421043Diagnosis : framework.Diagnosis {
10431044NodeToStatusMap : failedNodeStatues ,
10441045UnschedulablePlugins : sets .New (noderesources .Name ),
1046+ EvaluatedNodes : 100 ,
10451047},
10461048}
10471049if len (fmt .Sprint (expectErr )) > 150 {
@@ -1829,6 +1831,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
18291831"node2" : framework .NewStatus (framework .Unschedulable , tf .ErrReasonFake ).WithPlugin ("FalseFilter" ),
18301832},
18311833UnschedulablePlugins : sets .New ("FalseFilter" ),
1834+ EvaluatedNodes : 2 ,
18321835},
18331836},
18341837},
@@ -1919,6 +1922,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
19191922"1" : framework .NewStatus (framework .Unschedulable , tf .ErrReasonFake ).WithPlugin ("FalseFilter" ),
19201923},
19211924UnschedulablePlugins : sets .New ("FalseFilter" ),
1925+ EvaluatedNodes : 3 ,
19221926},
19231927},
19241928},
@@ -1945,6 +1949,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
19451949"2" : framework .NewStatus (framework .Unschedulable , tf .ErrReasonFake ).WithPlugin ("NoPodsFilter" ),
19461950},
19471951UnschedulablePlugins : sets .New ("MatchFilter" , "NoPodsFilter" ),
1952+ EvaluatedNodes : 2 ,
19481953},
19491954},
19501955},
@@ -2110,6 +2115,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
21102115"3" : framework .NewStatus (framework .Unschedulable , "injecting failure for pod test-filter" ).WithPlugin ("FakeFilter" ),
21112116},
21122117UnschedulablePlugins : sets .New ("FakeFilter" ),
2118+ EvaluatedNodes : 1 ,
21132119},
21142120},
21152121},
@@ -2143,6 +2149,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
21432149"3" : framework .NewStatus (framework .Unschedulable , "injecting failure for pod test-filter" ).WithPlugin ("FakeFilter" ),
21442150},
21452151UnschedulablePlugins : sets .New ("FakeFilter" , framework .ExtenderName ),
2152+ EvaluatedNodes : 3 ,
21462153},
21472154},
21482155},
@@ -2168,6 +2175,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
21682175"3" : framework .NewStatus (framework .UnschedulableAndUnresolvable , "injecting failure for pod test-filter" ).WithPlugin ("FakeFilter" ),
21692176},
21702177UnschedulablePlugins : sets .New ("FakeFilter" ),
2178+ EvaluatedNodes : 1 ,
21712179},
21722180},
21732181},
@@ -2249,7 +2257,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
22492257nodes : []string {"node1" , "node2" , "node3" },
22502258pod : st .MakePod ().Name ("test-prefilter" ).UID ("test-prefilter" ).Obj (),
22512259wantNodes : sets .New ("node2" ),
2252- wantEvaluatedNodes : ptr.To [int32 ](3 ),
2260+ wantEvaluatedNodes : ptr.To [int32 ](1 ),
22532261},
22542262{
22552263name : "test prefilter plugin returning non-intersecting nodes" ,
@@ -2338,6 +2346,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
23382346"node2" : framework .NewStatus (framework .Unschedulable , "injecting failure for pod test-prefilter" ).WithPlugin ("FakeFilter" ),
23392347},
23402348UnschedulablePlugins : sets .New ("FakeFilter" ),
2349+ EvaluatedNodes : 1 ,
23412350PreFilterMsg : "" ,
23422351},
23432352},
@@ -2416,10 +2425,11 @@ func TestSchedulerSchedulePod(t *testing.T) {
24162425),
24172426tf .RegisterBindPlugin (defaultbinder .Name , defaultbinder .New ),
24182427},
2419- nodes : []string {"node1" , "node2" , "node3" },
2420- pod : st .MakePod ().Name ("test-prefilter" ).UID ("test-prefilter" ).Obj (),
2421- wantNodes : sets .New ("node1" , "node2" ),
2422- wantEvaluatedNodes : ptr.To [int32 ](2 ),
2428+ nodes : []string {"node1" , "node2" , "node3" },
2429+ pod : st .MakePod ().Name ("test-prefilter" ).UID ("test-prefilter" ).Obj (),
2430+ wantNodes : sets .New ("node1" , "node2" ),
2431+ // since this case has no score plugin, we'll only try to find one node in Filter stage
2432+ wantEvaluatedNodes : ptr.To [int32 ](1 ),
24232433},
24242434}
24252435for _ , test := range tests {
@@ -2483,7 +2493,7 @@ func TestSchedulerSchedulePod(t *testing.T) {
24832493if gotOK != wantOK {
24842494t .Errorf ("Expected err to be FitError: %v, but got %v (error: %v)" , wantOK , gotOK , err )
24852495} else if gotOK {
2486- if diff := cmp .Diff (gotFitErr , wantFitErr ); diff != "" {
2496+ if diff := cmp .Diff (wantFitErr , gotFitErr ); diff != "" {
24872497t .Errorf ("Unexpected fitErr: (-want, +got): %s" , diff )
24882498}
24892499}
@@ -2536,6 +2546,7 @@ func TestFindFitAllError(t *testing.T) {
25362546"3" : framework .NewStatus (framework .Unschedulable , tf .ErrReasonFake ).WithPlugin ("MatchFilter" ),
25372547},
25382548UnschedulablePlugins : sets .New ("MatchFilter" ),
2549+ EvaluatedNodes : 3 ,
25392550}
25402551if diff := cmp .Diff (diagnosis , expected ); diff != "" {
25412552t .Errorf ("Unexpected diagnosis: (-want, +got): %s" , diff )
0 commit comments