@@ -675,6 +675,7 @@ func Test_InFlightPods(t *testing.T) {
675
675
}
676
676
fakeClock := testingclock .NewFakeClock (time .Now ())
677
677
q := NewTestQueueWithObjects (ctx , newDefaultQueueSort (), obj , WithQueueingHintMapPerProfile (test .queueingHintMap ), WithClock (fakeClock ))
678
+ sortOpt := cmpopts .SortSlices (func (a , b string ) bool { return a < b })
678
679
679
680
// When a Pod is added to the queue, the QueuedPodInfo will have a new timestamp.
680
681
// On Windows, time.Now() is not as precise, 2 consecutive calls may return the same timestamp.
@@ -734,7 +735,7 @@ func Test_InFlightPods(t *testing.T) {
734
735
for _ , pod := range pods {
735
736
podNames = append (podNames , pod .Name )
736
737
}
737
- if diff := cmp .Diff (test .wantActiveQPodNames , podNames ); diff != "" {
738
+ if diff := cmp .Diff (test .wantActiveQPodNames , podNames , sortOpt ); diff != "" {
738
739
t .Fatalf ("Unexpected diff of activeQ pod names (-want, +got):\n %s" , diff )
739
740
}
740
741
@@ -752,7 +753,7 @@ func Test_InFlightPods(t *testing.T) {
752
753
for _ , pInfo := range podInfos {
753
754
podNames = append (podNames , pInfo .Pod .Name )
754
755
}
755
- if diff := cmp .Diff (test .wantBackoffQPodNames , podNames ); diff != "" {
756
+ if diff := cmp .Diff (test .wantBackoffQPodNames , podNames , sortOpt ); diff != "" {
756
757
t .Fatalf ("Unexpected diff of backoffQ pod names (-want, +got):\n %s" , diff )
757
758
}
758
759
0 commit comments