diff --git a/consul/rpc_test.go b/consul/rpc_test.go index d823331c6b..5d1b7eb51c 100644 --- a/consul/rpc_test.go +++ b/consul/rpc_test.go @@ -33,7 +33,7 @@ func TestRPC_NoLeader_Fail(t *testing.T) { // Make sure we eventually fail with a no leader error, which we should // see given the short timeout. err := msgpackrpc.CallWithCodec(codec, "Catalog.Register", &arg, &out) - if err.Error() != structs.ErrNoLeader.Error() { + if err == nil || err.Error() != structs.ErrNoLeader.Error() { t.Fatalf("bad: %v", err) }