mirror of
https://github.com/status-im/consul.git
synced 2025-02-24 03:18:26 +00:00
Gets rid of flaky sort check.
If we get a coordinate then this test will fail, so we only check the first item in the list, which is deterministic.
This commit is contained in:
parent
8211c34924
commit
8a9ad3811b
@ -281,20 +281,13 @@ func TestCatalogListDatacenters_DistanceSort(t *testing.T) {
|
|||||||
// coordinates, so the best we can do is make sure that the sorting
|
// coordinates, so the best we can do is make sure that the sorting
|
||||||
// function is getting called (it's tested extensively in rtt_test.go).
|
// function is getting called (it's tested extensively in rtt_test.go).
|
||||||
// Since this is relative to dc1, it will be listed first (proving we
|
// Since this is relative to dc1, it will be listed first (proving we
|
||||||
// went into the sort fn) and the other two will be sorted by name since
|
// went into the sort fn).
|
||||||
// there are no known coordinates for them.
|
|
||||||
if len(out) != 3 {
|
if len(out) != 3 {
|
||||||
t.Fatalf("bad: %v", out)
|
t.Fatalf("bad: %v", out)
|
||||||
}
|
}
|
||||||
if out[0] != "dc1" {
|
if out[0] != "dc1" {
|
||||||
t.Fatalf("bad: %v", out)
|
t.Fatalf("bad: %v", out)
|
||||||
}
|
}
|
||||||
if out[1] != "acdc" {
|
|
||||||
t.Fatalf("bad: %v", out)
|
|
||||||
}
|
|
||||||
if out[2] != "dc2" {
|
|
||||||
t.Fatalf("bad: %v", out)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestCatalogListNodes(t *testing.T) {
|
func TestCatalogListNodes(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user