mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
Fix wait_for_connection to tolerate badrpc
This commit is contained in:
parent
f9972d8e11
commit
a24c091f27
@ -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).
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user