summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/health_check_SUITE.erl4
-rw-r--r--test/partitions_SUITE.erl16
2 files changed, 13 insertions, 7 deletions
diff --git a/test/health_check_SUITE.erl b/test/health_check_SUITE.erl
index 50abc97a02..44d42134ce 100644
--- a/test/health_check_SUITE.erl
+++ b/test/health_check_SUITE.erl
@@ -148,8 +148,8 @@ honors_timeout_argument(Config) ->
case timer:tc(rabbit_ct_broker_helpers, rabbitmqctl, [Config, A, ["-t", "5", "node_health_check"]]) of
{TimeSpent, {error, 75, _}} ->
- if TimeSpent < 5000000 -> exit({too_fast, TimeSpent});
- TimeSpent > 7000000 -> exit({too_slow, TimeSpent}); %% +2 seconds for rabbitmqctl overhead
+ if TimeSpent < 5000000 -> exit({too_fast, TimeSpent});
+ TimeSpent > 10000000 -> exit({too_slow, TimeSpent}); %% +5 seconds for rabbitmqctl overhead
true -> ok
end;
{_, Unexpected} ->
diff --git a/test/partitions_SUITE.erl b/test/partitions_SUITE.erl
index aa1c1df24f..e00c015d02 100644
--- a/test/partitions_SUITE.erl
+++ b/test/partitions_SUITE.erl
@@ -29,6 +29,10 @@
%% passes...
-define(DELAY, 8000).
+%% We wait for 5 minutes for nodes to be running/blocked.
+%% It's a lot, but still better than timetrap_timeout
+-define(AWAIT_TIMEOUT, 300000).
+
all() ->
[
{group, net_ticktime_1},
@@ -415,15 +419,17 @@ block(X, Y) ->
allow(X, Y) ->
rabbit_ct_broker_helpers:allow_traffic_between(X, Y).
-await_running (Node, Bool) -> await(Node, Bool, fun is_running/1).
-await_listening (Node, Bool) -> await(Node, Bool, fun is_listening/1).
-await_partitions(Node, Parts) -> await(Node, Parts, fun partitions/1).
+await_running (Node, Bool) -> await(Node, Bool, fun is_running/1, ?AWAIT_TIMEOUT).
+await_listening (Node, Bool) -> await(Node, Bool, fun is_listening/1, ?AWAIT_TIMEOUT).
+await_partitions(Node, Parts) -> await(Node, Parts, fun partitions/1, ?AWAIT_TIMEOUT).
-await(Node, Res, Fun) ->
+await(Node, Res, Fun, Timeout) when Timeout =< 0 ->
+ error({await_timeout, Node, Res, Fun});
+await(Node, Res, Fun, Timeout) ->
case Fun(Node) of
Res -> ok;
_ -> timer:sleep(100),
- await(Node, Res, Fun)
+ await(Node, Res, Fun, Timeout - 100)
end.
is_running(Node) -> rpc:call(Node, rabbit, is_running, []).