Skip to content

Commit 385b7e4

Browse files
committed
More logs and increased timeout
1 parent 8c9250d commit 385b7e4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

deps/rabbitmq_federation/test/queue_SUITE.erl

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
-compile(export_all).
1515

1616
-import(rabbit_federation_test_util,
17-
[wait_for_federation/2, expect/3, expect/4,
17+
[wait_for_federation/2, expect/3, expect/4, expect/2,
1818
set_upstream/4, set_upstream/5, clear_upstream/3, set_upstream_set/4, clear_upstream_set/3,
1919
set_policy/5, clear_policy/3,
2020
set_policy_pattern/5, set_policy_upstream/5, q/2, with_ch/3,
2121
maybe_declare_queue/3, delete_queue/2,
2222
federation_links_in_vhost/3]).
2323

2424
-define(INITIAL_WAIT, 6000).
25-
-define(EXPECT_FEDERATION_TIMEOUT, 30000).
25+
-define(EXPECT_FEDERATION_TIMEOUT, 60000).
2626

2727
all() ->
2828
[
@@ -368,7 +368,20 @@ publish_expect(Config, Ch, X, Key, Q, Payload, Timeout) ->
368368
Status = rabbit_ct_broker_helpers:rpc(Config, 0,
369369
rabbit_federation_status, status, []),
370370
ct:pal("Federation status ~p", [Status]),
371-
expect(Ch, Q, [Payload], Timeout).
371+
expect0(Config, Ch, Q, [Payload], Timeout).
372+
373+
expect0(Config, Ch, Q, Fun) when is_function(Fun) ->
374+
amqp_channel:subscribe(Ch, #'basic.consume'{queue = Q,
375+
no_ack = true}, self()),
376+
CTag = receive
377+
#'basic.consume_ok'{consumer_tag = CT} -> CT
378+
end,
379+
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"])]),
380+
Fun(),
381+
amqp_channel:call(Ch, #'basic.cancel'{consumer_tag = CTag}).
382+
383+
expect0(Config, Ch, Q, Payloads, Timeout) ->
384+
expect0(Config, Ch, Q, fun() -> expect(Payloads, Timeout) end).
372385

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

0 commit comments

Comments
 (0)