summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <klishinm@vmware.com>2021-03-04 19:43:16 +0300
committerMichael Klishin <michael@clojurewerkz.org>2021-03-13 05:15:09 +0300
commit073d602527ee728c6b559d2531e692547eeb7594 (patch)
treea6f2cb866c449e6392a72a52924282c00bbf33ea
parent878919c63e658e111eccfeeb85206b0115016e77 (diff)
downloadrabbitmq-server-git-073d602527ee728c6b559d2531e692547eeb7594.tar.gz
Merge pull request #2867 from rabbitmq/otp-24-federation
Await for links to start/fail to start on test suite (cherry picked from commit 3755b5b03fddd16b4ae4d0c192bdabcdd00c2ede)
-rw-r--r--deps/rabbitmq_federation/test/federation_status_command_SUITE.erl27
1 files changed, 16 insertions, 11 deletions
diff --git a/deps/rabbitmq_federation/test/federation_status_command_SUITE.erl b/deps/rabbitmq_federation/test/federation_status_command_SUITE.erl
index 4964ab1819..188914cee4 100644
--- a/deps/rabbitmq_federation/test/federation_status_command_SUITE.erl
+++ b/deps/rabbitmq_federation/test/federation_status_command_SUITE.erl
@@ -118,13 +118,15 @@ run_down_federated(Config) ->
rabbit_federation_test_util:with_ch(
Config,
fun(_) ->
- timer:sleep(3000),
- {stream, ManyProps} = ?CMD:run([], Opts#{only_down => false}),
- Links = [{proplists:get_value(upstream, Props),
- proplists:get_value(status, Props)}
- || Props <- ManyProps],
- [{<<"broken-bunny">>, error}, {<<"localhost">>, running}]
- = lists:sort(Links)
+ rabbit_ct_helpers:await_condition(
+ fun() ->
+ {stream, ManyProps} = ?CMD:run([], Opts#{only_down => false}),
+ Links = [{proplists:get_value(upstream, Props),
+ proplists:get_value(status, Props)}
+ || Props <- ManyProps],
+ [{<<"broken-bunny">>, error}, {<<"localhost">>, running}]
+ == lists:sort(Links)
+ end, 15000)
end,
[rabbit_federation_test_util:q(<<"upstream">>),
rabbit_federation_test_util:q(<<"fed.downstream">>)]),
@@ -132,10 +134,13 @@ run_down_federated(Config) ->
rabbit_federation_test_util:with_ch(
Config,
fun(_) ->
- timer:sleep(3000),
- {stream, [Props]} = ?CMD:run([], Opts#{only_down => true}),
- <<"broken-bunny">> = proplists:get_value(upstream, Props),
- error = proplists:get_value(status, Props)
+ rabbit_ct_helpers:await_condition(
+ fun() ->
+ {stream, Props} = ?CMD:run([], Opts#{only_down => true}),
+ (length(Props) == 1)
+ andalso (<<"broken-bunny">> == proplists:get_value(upstream, hd(Props)))
+ andalso (error == proplists:get_value(status, hd(Props)))
+ end, 15000)
end,
[rabbit_federation_test_util:q(<<"upstream">>),
rabbit_federation_test_util:q(<<"fed.downstream">>)]).