Skip to content

Commit d9ff6a0

Browse files
Merge pull request #12501 from rabbitmq/flake-clustering-queue-on-other-node
Tests: wait until stats are published, not just collected on the agent
2 parents 69960ea + 7d45609 commit d9ff6a0

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

deps/rabbitmq_management/test/clustering_SUITE.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,9 @@ queue_on_other_node(Config) ->
217217
consume(Chan2, <<"some-queue">>),
218218

219219
force_stats(Config),
220-
Res = http_get(Config, "/queues/%2F/some-queue"),
220+
?awaitMatch([_], maps:get(consumer_details, http_get(Config, "/queues/%2F/some-queue")), 60000),
221221

222+
Res = http_get(Config, "/queues/%2F/some-queue"),
222223
% assert some basic data is present
223224
[Cons] = maps:get(consumer_details, Res),
224225
#{} = maps:get(channel_details, Cons), % channel details proplist must not be empty

deps/rabbitmq_management/test/clustering_prop_SUITE.erl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ prop_connection_channel_counts(Config) ->
113113
execute_op(Config, Op, Agg)
114114
end, [], Ops),
115115
force_stats(Config),
116-
Res = validate_counts(Config, Cons),
116+
%% TODO retry a few times
117+
Res = retry_for(
118+
fun() -> validate_counts(Config, Cons) end,
119+
60),
117120
cleanup(Cons),
118121
rabbit_ct_helpers:await_condition(
119122
fun () -> validate_counts(Config, []) end,
@@ -275,3 +278,13 @@ dump_table(Config, Table) ->
275278
Data0 = rabbit_ct_broker_helpers:rpc(Config, 1, ets, tab2list, [Table]),
276279
ct:pal(?LOW_IMPORTANCE, "Node 1: Dump of table ~tp:~n~tp~n", [Table, Data0]).
277280

281+
retry_for(Fun, 0) ->
282+
false;
283+
retry_for(Fun, Retries) ->
284+
case Fun() of
285+
true ->
286+
true;
287+
false ->
288+
timer:sleep(1000),
289+
retry_for(Fun, Retries - 1)
290+
end.

0 commit comments

Comments
 (0)