Skip to content

Commit

Permalink
More logs and increased timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
dcorbacho committed Oct 28, 2024
1 parent 8c9250d commit 385b7e4
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions deps/rabbitmq_federation/test/queue_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
-compile(export_all).

-import(rabbit_federation_test_util,
[wait_for_federation/2, expect/3, expect/4,
[wait_for_federation/2, expect/3, expect/4, expect/2,
set_upstream/4, set_upstream/5, clear_upstream/3, set_upstream_set/4, clear_upstream_set/3,
set_policy/5, clear_policy/3,
set_policy_pattern/5, set_policy_upstream/5, q/2, with_ch/3,
maybe_declare_queue/3, delete_queue/2,
federation_links_in_vhost/3]).

-define(INITIAL_WAIT, 6000).
-define(EXPECT_FEDERATION_TIMEOUT, 30000).
-define(EXPECT_FEDERATION_TIMEOUT, 60000).

all() ->
[
Expand Down Expand Up @@ -368,7 +368,20 @@ publish_expect(Config, Ch, X, Key, Q, Payload, Timeout) ->
Status = rabbit_ct_broker_helpers:rpc(Config, 0,
rabbit_federation_status, status, []),
ct:pal("Federation status ~p", [Status]),
expect(Ch, Q, [Payload], Timeout).
expect0(Config, Ch, Q, [Payload], Timeout).

expect0(Config, Ch, Q, Fun) when is_function(Fun) ->
amqp_channel:subscribe(Ch, #'basic.consume'{queue = Q,
no_ack = true}, self()),
CTag = receive
#'basic.consume_ok'{consumer_tag = CT} -> CT
end,
ct:pal("After subscribe, messages and consumers in broker ~p ", [rabbit_ct_broker_helpers:rabbitmqctl_list(Config, 0, ["list_queues", "name", "messages", "messages_ready", "consumers"])]),
Fun(),
amqp_channel:call(Ch, #'basic.cancel'{consumer_tag = CTag}).

expect0(Config, Ch, Q, Payloads, Timeout) ->
expect0(Config, Ch, Q, fun() -> expect(Payloads, Timeout) end).

%% Doubled due to our strange basic.get behaviour.
expect_empty(Ch, Q) ->
Expand Down

0 comments on commit 385b7e4

Please sign in to comment.