@@ -64,7 +64,7 @@ var _ = ginkgo.Describe("InferencePool", func() {
64
64
for _ , m := range infModel .Spec .TargetModels {
65
65
expected = append (expected , m .Name )
66
66
}
67
- actual := [] string {}
67
+ actual := make ( map [ string ] int )
68
68
gomega .Eventually (func () error {
69
69
resp , err := testutils .ExecCommandInPod (ctx , cfg , scheme , kubeCli , nsName , "curl" , "curl" , curlCmd )
70
70
if err != nil {
@@ -75,12 +75,16 @@ var _ = ginkgo.Describe("InferencePool", func() {
75
75
}
76
76
for _ , m := range expected {
77
77
if strings .Contains (resp , m ) {
78
- actual = append ( actual , m )
78
+ actual [ m ] = 0
79
79
}
80
80
}
81
+ var got []string
82
+ for m := range actual {
83
+ got = append (got , m )
84
+ }
81
85
// Compare ignoring order
82
- if ! cmp .Equal (actual , expected , cmpopts .SortSlices (func (a , b string ) bool { return a < b })) {
83
- return fmt .Errorf ("actual (%v) != expected (%v); resp=%q" , actual , expected , resp )
86
+ if ! cmp .Equal (got , expected , cmpopts .SortSlices (func (a , b string ) bool { return a < b })) {
87
+ return fmt .Errorf ("actual (%v) != expected (%v); resp=%q" , got , expected , resp )
84
88
}
85
89
86
90
return nil
@@ -94,7 +98,7 @@ var _ = ginkgo.Describe("InferencePool", func() {
94
98
func newInferenceModel (ns string ) * infextv1a1.InferenceModel {
95
99
targets := []infextv1a1.TargetModel {
96
100
{
97
- Name : modelName + "% -0" ,
101
+ Name : modelName + "-0" ,
98
102
Weight : ptr .To (int32 (50 )),
99
103
},
100
104
{
0 commit comments