From d84c0b1a01b4252f85b71a4ade2543652a206024 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 13 Sep 2017 21:22:53 -0700 Subject: [PATCH] Robustifies check in TestCatalog_ListNodes_ConsistentRead_Fail test. Fixes #3469 --- agent/consul/catalog_endpoint_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/consul/catalog_endpoint_test.go b/agent/consul/catalog_endpoint_test.go index b2adffe04f..f1279e32bb 100644 --- a/agent/consul/catalog_endpoint_test.go +++ b/agent/consul/catalog_endpoint_test.go @@ -809,7 +809,8 @@ func TestCatalog_ListNodes_ConsistentRead_Fail(t *testing.T) { QueryOptions: structs.QueryOptions{RequireConsistent: true}, } var out structs.IndexedNodes - if err := msgpackrpc.CallWithCodec(codec, "Catalog.ListNodes", &args, &out); !strings.HasPrefix(err.Error(), "leadership lost") { + err := msgpackrpc.CallWithCodec(codec, "Catalog.ListNodes", &args, &out) + if err == nil || !strings.HasPrefix(err.Error(), "leadership lost") { t.Fatalf("err: %v", err) }