@@ -300,7 +300,7 @@ unpause_refresher(NodeName, _) ->
300300% % for each host in get_hosts().
301301% % Reads Redis to confirm that endpoints (in Redis) are overwritten
302302% % with `advertised_endpoints` option value
303- test_advertised_endpoints_override_endpoints (Config ) ->
303+ test_advertised_endpoints_override_endpoints (_Config ) ->
304304 Endps = execute_on_each_node (mod_global_distrib_mapping_redis ,
305305 get_endpoints ,
306306 [<<" reg1" >>]),
@@ -313,13 +313,15 @@ test_advertised_endpoints_override_endpoints(Config) ->
313313% % Also actually verifies that refresher properly reads host list
314314% % from backend and starts appropriate pool.
315315test_host_refreshing (_Config ) ->
316- mongoose_helper :wait_until (fun () -> trees_for_connections_present () end , true ),
316+ mongoose_helper :wait_until (fun () -> trees_for_connections_present () end , true ,
317+ #{name => trees_for_connections_present }),
317318 ConnectionSups = out_connection_sups (asia_node ),
318319 {europe_node1 , EuropeHost , _ } = lists :keyfind (europe_node1 , 1 , get_hosts ()),
319320 EuropeSup = rpc (asia_node , mod_global_distrib_utils , server_to_sup_name , [list_to_binary (EuropeHost )]),
320321 {_ , EuropePid , supervisor , _ } = lists :keyfind (EuropeSup , 1 , ConnectionSups ),
321322 erlang :exit (EuropePid , kill ), % it's ok to kill temporary process
322- mongoose_helper :wait_until (fun () -> tree_for_sup_present (asia_node , EuropeSup ) end , true ).
323+ mongoose_helper :wait_until (fun () -> tree_for_sup_present (asia_node , EuropeSup ) end , true ,
324+ #{name => tree_for_sup_present }).
323325
324326% % When run in mod_global_distrib group - tests simple case of connection
325327% % between two users connected to different clusters.
@@ -731,14 +733,8 @@ test_update_senders_host(Config) ->
731733 AliceJid = rpc (asia_node , jid , from_binary , [escalus_client :full_jid (Alice )]),
732734 {ok , <<" localhost.bis" >>}
733735 = rpc (asia_node , mod_global_distrib_mapping , for_jid , [AliceJid ]),
734-
735736 ok = rpc (europe_node1 , mod_global_distrib_mapping , delete_for_jid , [AliceJid ]),
736- GetCachesFun
737- = fun () ->
738- rpc (asia_node , mod_global_distrib_mapping , for_jid , [AliceJid ])
739- end ,
740- mongoose_helper :wait_until (GetCachesFun , error , #{time_left => timer :seconds (10 ),
741- sleep_time => timer :seconds (1 )}),
737+ wait_for_node (asia_node , AliceJid ),
742738
743739 % % TODO: Should prevent Redis refresher from executing for a moment,
744740 % % as it may collide with this test.
@@ -749,6 +745,12 @@ test_update_senders_host(Config) ->
749745 {ok , <<" localhost.bis" >>}
750746 = rpc (asia_node , mod_global_distrib_mapping , for_jid , [AliceJid ])
751747 end ).
748+ wait_for_node (Node ,Jid ) ->
749+ mongoose_helper :wait_until (fun () -> rpc (Node , mod_global_distrib_mapping , for_jid , [Jid ]) end ,
750+ error ,
751+ #{time_left => timer :seconds (10 ),
752+ sleep_time => timer :seconds (1 ),
753+ name => rpc }).
752754
753755test_update_senders_host_by_ejd_service (Config ) ->
754756 % % Connects to europe_node1
@@ -766,16 +768,8 @@ test_update_senders_host_by_ejd_service(Config) ->
766768 {ok , <<" reg1" >>} = rpc (europe_node2 , mod_global_distrib_mapping , for_jid , [EveJid ]),
767769
768770 ok = rpc (asia_node , mod_global_distrib_mapping , delete_for_jid , [EveJid ]),
769- GetCachesFun
770- = fun () ->
771- {
772- rpc (europe_node1 , mod_global_distrib_mapping , for_jid , [EveJid ]),
773- rpc (europe_node2 , mod_global_distrib_mapping , for_jid , [EveJid ])
774- }
775- end ,
776- mongoose_helper :wait_until (GetCachesFun , {error , error },
777- #{time_left => timer :seconds (10 ),
778- sleep_time => timer :seconds (1 )}),
771+ wait_for_node (europe_node1 , EveJid ),
772+ wait_for_node (europe_node2 , EveJid ),
779773
780774 % % Component is connected to europe_node1
781775 % % but we force asia_node to connect to europe_node2 by hiding europe_node1
@@ -875,7 +869,9 @@ closed_connection_is_removed_from_disabled(_Config) ->
875869 % Will drop connections and prevent them from reconnecting
876870 restart_receiver (asia_node , [listen_endpoint (10001 )]),
877871
878- mongoose_helper :wait_until (fun () -> get_outgoing_connections (europe_node1 , <<" reg1" >>) end , {[], [], []}).
872+ mongoose_helper :wait_until (fun () -> get_outgoing_connections (europe_node1 , <<" reg1" >>) end ,
873+ {[], [], []},
874+ #{name => get_outgoing_connections }).
879875
880876% %--------------------------------------------------------------------
881877% % Test helpers
@@ -1023,7 +1019,7 @@ mock_inet() ->
10231019 meck :expect (inet , getaddrs , fun (_ , inet ) -> {ok , [{127 , 0 , 0 , 1 }]};
10241020 (_ , inet6 ) -> {error , " No ipv6 address" } end ).
10251021
1026- unmock_inet (Pids ) ->
1022+ unmock_inet (_Pids ) ->
10271023 execute_on_each_node (meck , unload , [inet ]).
10281024
10291025out_connection_sups (Node ) ->
0 commit comments