Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: wait for links and metrics in prometheus_rabbitmq_federation_collector_SUITE (backport #12642) (backport #12647) #12648

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@ single_link_then_second_added(Config) ->
with_ch(
Config,
fun (Ch) ->
timer:sleep(3000),
[_L1] = rabbit_ct_broker_helpers:rpc(Config, 0,
rabbit_federation_status, status, []),
rabbit_ct_helpers:eventually(
?_assertMatch([_L1],
rabbit_ct_broker_helpers:rpc(
Config, 0, rabbit_federation_status, status, [])),
1000, 60),
rabbit_ct_helpers:eventually(?_assertEqual([?ONE_RUNNING_METRIC],
get_metrics(Config)),
500,
5),
1000,
30),
maybe_declare_queue(Config, Ch, q(<<"fed.downstream2">>, [{<<"x-queue-type">>, longstr, <<"classic">>}])),
%% here we race against queue.declare... most of the times there is going to be
%% new status=starting metric. In this case we wait a bit more for running=2.
Expand All @@ -116,14 +118,14 @@ single_link_then_second_added(Config) ->
[?ONE_RUNNING_METRIC] ->
rabbit_ct_helpers:eventually(?_assertEqual([?TWO_RUNNING_METRIC],
get_metrics(Config)),
500,
5);
1000,
30);
[?ONE_RUNNING_ONE_STARTING_METRIC] ->
rabbit_ct_helpers:eventually(?_assertEqual([?TWO_RUNNING_METRIC],
get_metrics(Config)),
500,
5)
1000,
30)

end,

delete_all(Ch, [q(<<"fed.downstream2">>, [{<<"x-queue-type">>, longstr, <<"classic">>}])])
Expand All @@ -133,12 +135,15 @@ two_links_from_the_start(Config) ->
with_ch(
Config,
fun (_Ch) ->
timer:sleep(3000),
[_L1 | _L2] = rabbit_ct_broker_helpers:rpc(Config, 0,
rabbit_federation_status, status, []),
MFs = get_metrics(Config),
[?TWO_RUNNING_METRIC] = MFs

rabbit_ct_helpers:eventually(
?_assertMatch([_L1 | _L2],
rabbit_ct_broker_helpers:rpc(
Config, 0, rabbit_federation_status, status, [])),
1000, 60),
rabbit_ct_helpers:eventually(?_assertEqual([?TWO_RUNNING_METRIC],
get_metrics(Config)),
1000,
30)
end, upstream_downstream() ++ [q(<<"fed.downstream2">>, [{<<"x-queue-type">>, longstr, <<"classic">>}])]).

%% -------------------------------------------------------------------
Expand Down
Loading