Skip to content

Commit 6b022bf

Browse files
committed
Meck inet instead of mod_global_distrib_utils
1 parent 709bc4f commit 6b022bf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

big_tests/tests/mod_global_distrib_SUITE.erl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,13 +1171,14 @@ execute_on_each_node(M, F, A) ->
11711171
lists:map(fun({NodeName, _, _}) -> rpc(NodeName, M, F, A) end, get_hosts()).
11721172

11731173
mock_inet() ->
1174-
%% We don't want to mock inet module itself to avoid strange networking issues
1175-
meck:new(mod_global_distrib_utils, [non_strict, passthrough, unstick]),
1176-
meck:expect(mod_global_distrib_utils, getaddrs, fun(_, inet) -> {ok, [{127, 0, 0, 1}]};
1177-
(_, inet6) -> {error, "No ipv6 address"} end).
1174+
%% We can only mock MongooseIM modules on mim1.
1175+
%% Otherwise meck will freeze calling cover_server process.
1176+
meck:new(inet, [non_strict, passthrough, unstick]),
1177+
meck:expect(inet, getaddrs, fun(_, inet) -> {ok, [{127, 0, 0, 1}]};
1178+
(_, inet6) -> {error, "No ipv6 address"} end).
11781179

11791180
unmock_inet(_Pids) ->
1180-
execute_on_each_node(meck, unload, [mod_global_distrib_utils]).
1181+
execute_on_each_node(meck, unload, [inet]).
11811182

11821183
out_connection_sups(Node) ->
11831184
Children = rpc(Node, supervisor, which_children, [mod_global_distrib_outgoing_conns_sup]),

0 commit comments

Comments
 (0)