Skip to content

Commit

Permalink
Made core vnode eqc tolerant of vnodes shutting down still being in t…
Browse files Browse the repository at this point in the history
…he supervisor.
  • Loading branch information
Jon Meredith committed Sep 21, 2011
1 parent a32f91a commit 347a9eb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/core_vnode_eqc.erl
Expand Up @@ -66,6 +66,8 @@ prop_simple() ->
%% Check results
?WHENFAIL(
begin
io:format(user, "Cmds: ~p~n",
[zip(state_names(H), command_names(Cmds))]),
io:format(user, "History: ~p\n", [H]),
io:format(user, "State: ~p\n", [S]),
io:format(user, "Result: ~p\n", [Res])
Expand Down Expand Up @@ -223,7 +225,17 @@ postcondition(_From,_To,_S,
postcondition(_From,_To,_S,
{call,riak_core_vnode_master,all_nodes,[mock_vnode]},Result) ->
Pids = [Pid || {_,Pid,_,_} <- supervisor:which_children(riak_core_vnode_sup)],
lists:sort(Result) =:= lists:sort(Pids);
SPids = ordsets:from_list(Pids),
SResult = ordsets:from_list(Result),
%% Check if there are any pids returned by master that are not in the
%% sup. There may be vnodes shutting down still in the sup, but master will
%% not reference them.
case ordsets:subtract(SResult, SPids) of
[] ->
true;
MasterNotSup ->
{pids_in_master_not_sup, MasterNotSup, all_nodes, Result, sup, Pids}
end;
postcondition(_From,_To,_S,_C,_R) ->
true.

Expand Down

0 comments on commit 347a9eb

Please sign in to comment.