Skip to content

Commit

Permalink
fix flaky test:LessEqualWithResourcesName
Browse files Browse the repository at this point in the history
Signed-off-by: Xuzheng Chang <[email protected]>
  • Loading branch information
Monokaix committed Aug 2, 2023
1 parent bb61bbd commit 6150894
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/scheduler/api/resource_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package api
import (
"math"
"reflect"
"sort"
"testing"

v1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -1379,7 +1380,9 @@ func TestResource_LessEqualResource(t *testing.T) {
}

for _, test := range testsForDefaultZero {
sort.Strings(test.expected)
_, reason := test.resource1.LessEqualWithResourcesName(test.resource2, Zero)
sort.Strings(reason)
if !reflect.DeepEqual(test.expected, reason) {
t.Errorf("expected: %#v, got: %#v", test.expected, reason)
}
Expand Down

0 comments on commit 6150894

Please sign in to comment.