replace sets.List() with sets.UnsortedList()

This commit is contained in:
m1093782566
2017-11-13 10:20:54 +08:00
parent 338ee7f5d5
commit 83ada5c7bf
5 changed files with 10 additions and 10 deletions

View File

@@ -1050,7 +1050,7 @@ func TestBuildServiceMapAddRemove(t *testing.T) {
// the not-deleted service, because one of it's ServicePorts was deleted.
expectedStaleUDPServices := []string{"172.16.55.10", "172.16.55.4", "172.16.55.11", "172.16.55.12"}
if len(result.staleServices) != len(expectedStaleUDPServices) {
t.Errorf("expected stale UDP services length %d, got %v", len(expectedStaleUDPServices), result.staleServices.List())
t.Errorf("expected stale UDP services length %d, got %v", len(expectedStaleUDPServices), result.staleServices.UnsortedList())
}
for _, ip := range expectedStaleUDPServices {
if !result.staleServices.Has(ip) {
@@ -1166,7 +1166,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) {
t.Errorf("expected healthcheck ports length 1, got %v", result.hcServices)
}
if len(result.staleServices) != 0 {
t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.List())
t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.UnsortedList())
}
// No change; make sure the service map stays the same and there are
@@ -1180,7 +1180,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) {
t.Errorf("expected healthcheck ports length 1, got %v", result.hcServices)
}
if len(result.staleServices) != 0 {
t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.List())
t.Errorf("expected stale UDP services length 0, got %v", result.staleServices.UnsortedList())
}
// And back to ClusterIP