From 8a9ad3811b59edcaa1a4f392577fda10a590c0a1 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Mon, 21 Mar 2016 17:30:05 -0700 Subject: [PATCH] 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. --- consul/catalog_endpoint_test.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/consul/catalog_endpoint_test.go b/consul/catalog_endpoint_test.go index 603dc15b74..28b22b2d0e 100644 --- a/consul/catalog_endpoint_test.go +++ b/consul/catalog_endpoint_test.go @@ -281,20 +281,13 @@ func TestCatalogListDatacenters_DistanceSort(t *testing.T) { // 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). // 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 - // there are no known coordinates for them. + // went into the sort fn). if len(out) != 3 { t.Fatalf("bad: %v", out) } if out[0] != "dc1" { 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) {