Skip to content

Commit

Permalink
Updated tests and merged in new gproc branch
Browse files Browse the repository at this point in the history
  • Loading branch information
auser committed Jul 16, 2010
1 parent 0ebd863 commit a652a49
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions test/src/cluster_srv_tests.erl
Expand Up @@ -73,17 +73,20 @@ run_tests() ->

node_global_takeover() ->
Node1Pid = whereis(node0),
{ok, Name1} = gen_cluster:call(Node1Pid, {'$gen_cluster', globally_registered_name}),
case gen_cluster:call(Node1Pid, {'$gen_cluster', globally_registered_name}) of
{ok, Name1} ->
GlobalPid1 = global:whereis_name(Name1),
?assert(is_process_alive(GlobalPid1)),

GlobalPid1 = global:whereis_name(Name1),
?assert(is_process_alive(GlobalPid1)),

gen_cluster:cast(Node1Pid, stop),
timer:sleep(500),
gen_cluster:cast(Node1Pid, stop),
timer:sleep(500),

GlobalPid2 = global:whereis_name(Name1),
?assert(GlobalPid1 =/= GlobalPid2),
?assert(is_process_alive(GlobalPid2)),
GlobalPid2 = global:whereis_name(Name1),
?assert(GlobalPid1 =/= GlobalPid2),
?assert(is_process_alive(GlobalPid2));
_ ->
unhandled_yet
end,

% {ok, _Node4Pid} = example_cluster_srv:start_named(node4, {seed, GlobalPid2}),
passed.
Expand Down

0 comments on commit a652a49

Please sign in to comment.