test(peer): increase init and startup timeout for peer nodes
Attempt to stabilize tests that use cluster nodes.
This commit is contained in:
parent
0e5a22f500
commit
8b5a717a1f
|
@ -660,6 +660,7 @@ start_slave(Name, Opts) when is_list(Opts) ->
|
||||||
start_slave(Name, Opts) when is_map(Opts) ->
|
start_slave(Name, Opts) when is_map(Opts) ->
|
||||||
SlaveMod = maps:get(peer_mod, Opts, ct_slave),
|
SlaveMod = maps:get(peer_mod, Opts, ct_slave),
|
||||||
Node = node_name(Name),
|
Node = node_name(Name),
|
||||||
|
put_peer_mod(Node, SlaveMod),
|
||||||
DoStart =
|
DoStart =
|
||||||
fun() ->
|
fun() ->
|
||||||
case SlaveMod of
|
case SlaveMod of
|
||||||
|
@ -669,8 +670,8 @@ start_slave(Name, Opts) when is_map(Opts) ->
|
||||||
[
|
[
|
||||||
{kill_if_fail, true},
|
{kill_if_fail, true},
|
||||||
{monitor_master, true},
|
{monitor_master, true},
|
||||||
{init_timeout, 10000},
|
{init_timeout, 20_000},
|
||||||
{startup_timeout, 10000},
|
{startup_timeout, 20_000},
|
||||||
{erl_flags, erl_flags()}
|
{erl_flags, erl_flags()}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -687,7 +688,6 @@ start_slave(Name, Opts) when is_map(Opts) ->
|
||||||
throw(Other)
|
throw(Other)
|
||||||
end,
|
end,
|
||||||
pong = net_adm:ping(Node),
|
pong = net_adm:ping(Node),
|
||||||
put_peer_mod(Node, SlaveMod),
|
|
||||||
setup_node(Node, Opts),
|
setup_node(Node, Opts),
|
||||||
ok = snabbkaffe:forward_trace(Node),
|
ok = snabbkaffe:forward_trace(Node),
|
||||||
Node.
|
Node.
|
||||||
|
|
|
@ -388,7 +388,9 @@ end_per_testcase(_Testcase, Config) ->
|
||||||
maps:values(ProducersMapping)
|
maps:values(ProducersMapping)
|
||||||
),
|
),
|
||||||
ok = wolff:stop_and_delete_supervised_client(KafkaProducerClientId),
|
ok = wolff:stop_and_delete_supervised_client(KafkaProducerClientId),
|
||||||
emqx_common_test_helpers:call_janitor(30_000),
|
%% in CI, apparently this needs more time since the
|
||||||
|
%% machines struggle with all the containers running...
|
||||||
|
emqx_common_test_helpers:call_janitor(60_000),
|
||||||
ok = snabbkaffe:stop(),
|
ok = snabbkaffe:stop(),
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
@ -1664,7 +1666,7 @@ t_cluster_group(Config) ->
|
||||||
|| {Name, Opts} <- Cluster
|
|| {Name, Opts} <- Cluster
|
||||||
],
|
],
|
||||||
on_exit(fun() ->
|
on_exit(fun() ->
|
||||||
lists:foreach(
|
emqx_misc:pmap(
|
||||||
fun(N) ->
|
fun(N) ->
|
||||||
ct:pal("stopping ~p", [N]),
|
ct:pal("stopping ~p", [N]),
|
||||||
ok = emqx_common_test_helpers:stop_slave(N)
|
ok = emqx_common_test_helpers:stop_slave(N)
|
||||||
|
@ -1875,7 +1877,7 @@ t_cluster_node_down(Config) ->
|
||||||
Cluster
|
Cluster
|
||||||
),
|
),
|
||||||
on_exit(fun() ->
|
on_exit(fun() ->
|
||||||
lists:foreach(
|
emqx_misc:pmap(
|
||||||
fun(N) ->
|
fun(N) ->
|
||||||
ct:pal("stopping ~p", [N]),
|
ct:pal("stopping ~p", [N]),
|
||||||
ok = emqx_common_test_helpers:stop_slave(N)
|
ok = emqx_common_test_helpers:stop_slave(N)
|
||||||
|
@ -1894,11 +1896,15 @@ t_cluster_node_down(Config) ->
|
||||||
{ok, _} = snabbkaffe:receive_events(SRef0),
|
{ok, _} = snabbkaffe:receive_events(SRef0),
|
||||||
lists:foreach(
|
lists:foreach(
|
||||||
fun(N) ->
|
fun(N) ->
|
||||||
|
?retry(
|
||||||
|
_Sleep1 = 100,
|
||||||
|
_Attempts1 = 50,
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
{ok, _},
|
{ok, _},
|
||||||
erpc:call(N, emqx_bridge, lookup, [BridgeId]),
|
erpc:call(N, emqx_bridge, lookup, [BridgeId]),
|
||||||
#{node => N}
|
#{node => N}
|
||||||
)
|
)
|
||||||
|
)
|
||||||
end,
|
end,
|
||||||
Nodes
|
Nodes
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue