diff --git a/tests/repl_util.erl b/tests/repl_util.erl index e3f78c4c..a9e12210 100644 --- a/tests/repl_util.erl +++ b/tests/repl_util.erl @@ -178,20 +178,24 @@ disconnect_cluster(Node, Name) -> wait_for_connection(Node, Name) -> rt:wait_until(Node, fun(_) -> - {ok, Connections} = rpc:call(Node, riak_core_cluster_mgr, - get_connections, []), - Conn = [P || {{cluster_by_name, N}, P} <- Connections, N == Name], - case Conn of - [] -> - false; - [Pid] -> - Pid ! {self(), status}, - receive - {Pid, status, _} -> - true; - {Pid, connecting, _} -> - false - end + case rpc:call(Node, riak_core_cluster_mgr, + get_connections, []) of + {ok, Connections} -> + Conn = [P || {{cluster_by_name, N}, P} <- Connections, N == Name], + case Conn of + [] -> + false; + [Pid] -> + Pid ! {self(), status}, + receive + {Pid, status, _} -> + true; + {Pid, connecting, _} -> + false + end + end; + _ -> + false end end).