Skip to content

Commit

Permalink
Move join_interrupted_when_ping_crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Mar 12, 2024
1 parent 206affb commit 011e118
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
15 changes: 0 additions & 15 deletions test/cets_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ seq_cases() ->
insert_returns_when_netsplit,
inserts_after_netsplit_reconnects,
cets_ping_all_returns_when_ping_crashes,
join_interrupted_when_ping_crashes,
ping_pairs_returns_pongs,
ping_pairs_returns_earlier,
pre_connect_fails_on_our_node,
Expand All @@ -204,7 +203,6 @@ seq_cases() ->

cets_seq_no_log_cases() ->
[
join_interrupted_when_ping_crashes,
node_down_history_is_updated_when_netsplit_happens,
send_check_servers_is_called_before_last_server_got_dump,
remote_ops_are_not_sent_before_last_server_got_dump
Expand Down Expand Up @@ -1495,19 +1493,6 @@ cets_ping_all_returns_when_ping_crashes(Config) ->
?assertMatch({error, [{Pid2, {'EXIT', {simulate_crash, _}}}]}, cets:ping_all(Pid1)),
meck:unload().

join_interrupted_when_ping_crashes(Config) ->
#{pid1 := Pid1, pid2 := Pid2} = given_two_joined_tables(Config),
Tab3 = make_name(Config, 3),
{ok, Pid3} = start_local(Tab3, #{}),
meck:new(cets, [passthrough]),
meck:expect(cets_call, long_call, fun
(Server, ping) when Server == Pid2 -> error(simulate_crash);
(Server, Msg) -> meck:passthrough([Server, Msg])
end),
Res = cets_join:join(lock_name(Config), #{}, Pid1, Pid3),
?assertMatch({error, {task_failed, ping_all_failed, #{}}}, Res),
meck:unload().

node_down_history_is_updated_when_netsplit_happens(Config) ->
%% node_down_history is available in cets:info/1 API.
%% It could be used for manual debugging in situations
Expand Down
24 changes: 20 additions & 4 deletions test/cets_join_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ all() ->
[
{group, cets},
{group, cets_no_log},
{group, cets_seq}
% {group, cets_seq_no_log}
{group, cets_seq},
{group, cets_seq_no_log}
].

only_for_logger_cases() ->
Expand Down Expand Up @@ -121,11 +121,14 @@ cases() ->
seq_cases() ->
[
joining_not_fully_connected_node_is_not_allowed,
joining_not_fully_connected_node_is_not_allowed2
joining_not_fully_connected_node_is_not_allowed2,
join_interrupted_when_ping_crashes
].

cets_seq_no_log_cases() ->
[].
[
join_interrupted_when_ping_crashes
].

init_per_suite(Config) ->
cets_test_setup:init_cleanup_table(),
Expand Down Expand Up @@ -604,6 +607,19 @@ joining_not_fully_connected_node_is_not_allowed2(Config) ->
end,
[] = cets:other_pids(Pid5).

join_interrupted_when_ping_crashes(Config) ->
#{pid1 := Pid1, pid2 := Pid2} = given_two_joined_tables(Config),
Tab3 = make_name(Config, 3),
{ok, Pid3} = start_local(Tab3, #{}),
meck:new(cets, [passthrough]),
meck:expect(cets_call, long_call, fun
(Server, ping) when Server == Pid2 -> error(simulate_crash);
(Server, Msg) -> meck:passthrough([Server, Msg])
end),
Res = cets_join:join(lock_name(Config), #{}, Pid1, Pid3),
?assertMatch({error, {task_failed, ping_all_failed, #{}}}, Res),
meck:unload().

%% Helpers

send_join_start_back_and_wait_for_continue_joining() ->
Expand Down

0 comments on commit 011e118

Please sign in to comment.