make rt:wait_for_service less racey

This commit is contained in:
Joe DeVivo 2013-02-12 11:05:20 -07:00
parent d9a2acdcf2
commit 0b0ddcca09

View File

@ -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;