Skip to content

Commit e51cce3

Browse files
committed
scheduler: un-flake TestSystemSched_evictUnneededCanaries
1 parent d318f0f commit e51cce3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scheduler/scheduler_system_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3958,15 +3958,15 @@ func TestSystemSched_evictUnneededCanaries(t *testing.T) {
39583958
requiredCanaries int
39593959
tgName string
39603960
nodeAllocation map[string][]*structs.Allocation
3961-
expectedDesiredCanaries []string
3961+
expectedDesiredCanaries int
39623962
expectedNodeAllocation map[string][]*structs.Allocation
39633963
}{
39643964
{
39653965
name: "no required canaries",
39663966
requiredCanaries: 0,
39673967
tgName: "foo",
39683968
nodeAllocation: nil,
3969-
expectedDesiredCanaries: []string{},
3969+
expectedDesiredCanaries: 0,
39703970
expectedNodeAllocation: nil,
39713971
},
39723972
{
@@ -3997,7 +3997,7 @@ func TestSystemSched_evictUnneededCanaries(t *testing.T) {
39973997
},
39983998
},
39993999
},
4000-
expectedDesiredCanaries: []string{},
4000+
expectedDesiredCanaries: 0,
40014001
expectedNodeAllocation: map[string][]*structs.Allocation{
40024002
"node1": {
40034003
{
@@ -4053,7 +4053,7 @@ func TestSystemSched_evictUnneededCanaries(t *testing.T) {
40534053
},
40544054
},
40554055
},
4056-
expectedDesiredCanaries: []string{"tg1_alloc1"},
4056+
expectedDesiredCanaries: 1,
40574057
expectedNodeAllocation: map[string][]*structs.Allocation{
40584058
"node1": {
40594059
{
@@ -4084,7 +4084,7 @@ func TestSystemSched_evictUnneededCanaries(t *testing.T) {
40844084
}
40854085
s.plan.NodeAllocation = tt.nodeAllocation
40864086

4087-
must.Eq(t, tt.expectedDesiredCanaries, s.evictUnneededCanaries(tt.requiredCanaries, tt.tgName, &reconciler.NodeReconcileResult{}), must.Sprint("unexpected desired canaries"))
4087+
must.SliceLen(t, tt.expectedDesiredCanaries, s.evictUnneededCanaries(tt.requiredCanaries, tt.tgName, &reconciler.NodeReconcileResult{}), must.Sprint("unexpected desired canaries"))
40884088
must.Eq(t, tt.expectedNodeAllocation, s.plan.NodeAllocation, must.Sprintf("unexpected node allocation"))
40894089
})
40904090
}

0 commit comments

Comments
 (0)