Skip to content

Commit 6180d70

Browse files
committed
/pkg/scheduler/framework/plugins/ : remove the repeat test example and add an test example
1 parent b9c370c commit 6180d70

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pkg/scheduler/framework/plugins/defaultpodtopologyspread/default_pod_topology_spread_test.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -578,19 +578,20 @@ func TestZoneSelectorSpreadPriority(t *testing.T) {
578578
pods: []*v1.Pod{
579579
buildPod(nodeMachine1Zone1, labels1, nil),
580580
buildPod(nodeMachine1Zone2, labels1, nil),
581-
buildPod(nodeMachine1Zone3, labels1, nil),
581+
buildPod(nodeMachine2Zone2, labels1, nil),
582582
buildPod(nodeMachine2Zone2, labels2, nil),
583+
buildPod(nodeMachine1Zone3, labels1, nil),
583584
},
584585
services: []*v1.Service{{Spec: v1.ServiceSpec{Selector: labels1}}},
585586
expectedList: []framework.NodeScore{
586-
{Name: nodeMachine1Zone1, Score: 0}, // Pod on node
587+
{Name: nodeMachine1Zone1, Score: 33}, // Pod on node
587588
{Name: nodeMachine1Zone2, Score: 0}, // Pod on node
588-
{Name: nodeMachine2Zone2, Score: 33}, // Pod in zone
589-
{Name: nodeMachine1Zone3, Score: 0}, // Pod on node
590-
{Name: nodeMachine2Zone3, Score: 33}, // Pod in zone
591-
{Name: nodeMachine3Zone3, Score: 33}, // Pod in zone
589+
{Name: nodeMachine2Zone2, Score: 0}, // Pod in zone
590+
{Name: nodeMachine1Zone3, Score: 33}, // Pod on node
591+
{Name: nodeMachine2Zone3, Score: 66}, // Pod in zone
592+
{Name: nodeMachine3Zone3, Score: 66}, // Pod in zone
592593
},
593-
name: "four pods, 3 matching (z1=1, z2=1, z3=1)",
594+
name: "five pods, 4 matching (z1=1, z2=2, z3=1)",
594595
},
595596
{
596597
pod: buildPod("", labels1, controllerRef("ReplicationController", "name", "abc123")),

0 commit comments

Comments
 (0)