mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
make rt:wait_for_service less racey
This commit is contained in:
parent
d9a2acdcf2
commit
0b0ddcca09
10
src/rt.erl
10
src/rt.erl
@ -578,8 +578,14 @@ wait_until_transfers_complete([Node0|_]) ->
|
||||
|
||||
wait_for_service(Node, Services) when is_list(Services) ->
|
||||
F = fun(N) ->
|
||||
CurrServices = rpc:call(N, riak_core_node_watcher, services, [N]),
|
||||
lists:all(fun(Service) -> lists:member(Service, CurrServices) end, Services)
|
||||
case rpc:call(N, riak_core_node_watcher, services, [N]) of
|
||||
{badrpc, _Error} ->
|
||||
false;
|
||||
CurrServices when is_list(CurrServices) ->
|
||||
lists:all(fun(Service) -> lists:member(Service, CurrServices) end, Services);
|
||||
_ ->
|
||||
false
|
||||
end
|
||||
end,
|
||||
?assertEqual(ok, wait_until(Node, F)),
|
||||
ok;
|
||||
|
Loading…
Reference in New Issue
Block a user