summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilip Kuryloski <kuryloskip@vmware.com>2020-06-09 14:44:23 +0200
committerPhilip Kuryloski <kuryloskip@vmware.com>2020-06-09 14:44:23 +0200
commita3fa9c857b2c79c4bec8a41db1f1438a91396ebb (patch)
treed22ef7892a0fbb2e4fa09d500b8538174d9916aa /test
parenta74639c305173da50a472b289d42d3c461bc1909 (diff)
downloadrabbitmq-server-git-a3fa9c857b2c79c4bec8a41db1f1438a91396ebb.tar.gz
Stricter setup in the confirms_survive_* tests
Wait until at least one message has been confirmed before triggering the survivable change
Diffstat (limited to 'test')
-rw-r--r--test/simple_ha_SUITE.erl16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/simple_ha_SUITE.erl b/test/simple_ha_SUITE.erl
index 7cf21a92eb..10d8eda9ee 100644
--- a/test/simple_ha_SUITE.erl
+++ b/test/simple_ha_SUITE.erl
@@ -259,6 +259,22 @@ confirms_survive(Config, DeathFun) ->
auto_delete = false,
durable = true}),
+ %% send one message to ensure the channel is flowing
+ amqp_channel:register_confirm_handler(Node1Channel, self()),
+ #'confirm.select_ok'{} = amqp_channel:call(Node1Channel, #'confirm.select'{}),
+
+ Payload = <<"initial message">>,
+ ok = amqp_channel:call(Node1Channel,
+ #'basic.publish'{routing_key = Queue},
+ #amqp_msg{payload = Payload}),
+
+ ok = receive
+ #'basic.ack'{multiple = false} -> ok;
+ #'basic.nack'{multiple = false} -> message_nacked
+ after
+ 5000 -> confirm_not_received
+ end,
+
%% send a bunch of messages from the producer
ProducerPid = rabbit_ha_test_producer:create(Node2Channel, Queue,
self(), true, Msgs),