Skip to content

Commit

Permalink
fixed the failing GTP test (#231)
Browse files Browse the repository at this point in the history
Signed-off-by: Shriram Sharma <shriram_sharma@intuit.com>
  • Loading branch information
shriramsharma committed Jun 17, 2022
1 parent 01d8e56 commit d8b06cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions admiral/pkg/controller/admiral/globaltraffic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package admiral

import (
"reflect"
"sort"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -247,6 +248,9 @@ func TestGlobalTrafficController_Added(t *testing.T) {
gtpController.Added(g)
}
matchedGtps := gtpController.Cache.Get(c.gtpKey, c.namespace)
sort.Slice(matchedGtps, func(i, j int) bool {
return matchedGtps[i].Name < matchedGtps[j].Name
})
if !reflect.DeepEqual(c.expectedGtps, matchedGtps) {
t.Errorf("Test %s failed; expected %v, got %v", c.name, c.expectedGtps, matchedGtps)
}
Expand Down

0 comments on commit d8b06cb

Please sign in to comment.