Browse Source

Make sure t_fail_node() doesn't kill the master node.

Ulf Wiger 7 years ago
parent
commit
e7fe30fbd5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      test/gproc_dist_tests.erl

+ 5 - 1
test/gproc_dist_tests.erl

@@ -575,7 +575,11 @@ t_sync_cand_dies([A,B,C]) ->
     %% immediately. Therefore, we should have our answer well within 1 sec.
     ?assertMatch({value, true}, rpc:nb_yield(Key, 1000)).
 
-t_fail_node([A,B|_] = Ns) ->
+%% Verify that the registry updates consistently if a non-leader node
+%% dies.
+t_fail_node(Ns) ->
+    Leader = rpc:call(hd(Ns), gproc_dist, get_leader, []),
+    [A,B] = Ns -- [Leader],
     Na = ?T_NAME,
     Nb = ?T_NAME,
     Pa = t_spawn_reg(A, Na),