mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Fixed cluster connection detmination function.
Due to the refactor for the cluster manager/connection manager system to use otp behaviors, the raw message method of getting stats has been ousted. Instead, it uses a call. To allow the riak_test to be able to check older clusters as well as the method, the function was extended to try new and then the old.
This commit is contained in:
parent
43ee07c579
commit
d1891f69fd
@ -242,7 +242,7 @@ start_and_wait_until_fullsync_complete(Node, Cluster, NotifyPid, Retries) ->
|
||||
_ when Retries > 0 ->
|
||||
?assertEqual(ok, wait_until_connection(Node)),
|
||||
lager:warning("Node failed to fullsync, retrying"),
|
||||
start_and_wait_until_fullsync_complete(Node, Retries-1)
|
||||
start_and_wait_until_fullsync_complete(Node, Cluster, NotifyPid, Retries-1)
|
||||
end,
|
||||
lager:info("Fullsync on ~p complete", [Node]).
|
||||
|
||||
@ -254,8 +254,10 @@ fullsync_count(Count, _Status, _Cluster) ->
|
||||
Count + 1.
|
||||
|
||||
fullsync_start_args(undefined) ->
|
||||
lager:info("No cluster for fullsync start"),
|
||||
["start"];
|
||||
fullsync_start_args(Cluster) ->
|
||||
lager:info("Cluster for fullsync start: ~p", [Cluster]),
|
||||
["start", Cluster].
|
||||
|
||||
fullsync_notify(NotifyPid) when is_pid(NotifyPid) ->
|
||||
@ -300,6 +302,12 @@ wait_for_connection(Node, Name) ->
|
||||
[] ->
|
||||
false;
|
||||
[Pid] ->
|
||||
try riak_core_cluster_conn:status(Pid, 2) of {Pid, status, _} ->
|
||||
true;
|
||||
_ ->
|
||||
false
|
||||
catch
|
||||
_W:_Y ->
|
||||
Pid ! {self(), status},
|
||||
receive
|
||||
{Pid, status, _} ->
|
||||
@ -307,6 +315,7 @@ wait_for_connection(Node, Name) ->
|
||||
{Pid, connecting, _} ->
|
||||
false
|
||||
end
|
||||
end
|
||||
end;
|
||||
_ ->
|
||||
false
|
||||
|
Loading…
Reference in New Issue
Block a user