mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 08:35:22 +00:00
Wait for 'cluster plan' to succeed (verify_staged_clustering)
While running the `verify_staged_clustering` test on my local workstation I hit a race when force replacing dev3 with dev2. The call to 'cluster plan' was happening before the ring had converged and thus failing, but the test assumed the first call always succeeds. This patch simply mimicks what a user might do and retry the 'cluster plan' command over and over until it succeeds.
This commit is contained in:
parent
00b70c6e77
commit
9f160e60ad
@ -137,7 +137,14 @@ stage_force_replace(Node, Node1, Node2) ->
|
||||
|
||||
print_staged(Node) ->
|
||||
%% rpc:call(Node, riak_core_console, print_staged, [[]]).
|
||||
rt:admin(Node, ["cluster", "plan"]).
|
||||
F = fun(_) ->
|
||||
{ok, StdOut} = rt:admin(Node, ["cluster", "plan"]),
|
||||
case StdOut of
|
||||
"Cannot" ++ _X -> false;
|
||||
_ -> true
|
||||
end
|
||||
end,
|
||||
rt:wait_until(Node, F).
|
||||
|
||||
commit_staged(Node) ->
|
||||
%% rpc:call(Node, riak_core_console, commit_staged, [[]]).
|
||||
|
Loading…
Reference in New Issue
Block a user