summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Kuryloski <kuryloskip@vmware.com>2020-06-04 10:30:01 +0200
committerPhilip Kuryloski <kuryloskip@vmware.com>2020-06-04 10:30:01 +0200
commit8f3a718c7dbebda620f03ac8468be9493257eee5 (patch)
tree73d9956053fc443e5977cd6642d3018f7d722aca
parent9083a01b59195bf1202b74f504b5ae47ba110a6a (diff)
downloadrabbitmq-server-git-8f3a718c7dbebda620f03ac8468be9493257eee5.tar.gz
Attempt to increase stability of simple_ha_SUITE
Wait for an ack on the first message sent to the queue before proceeding with the test, since we assert on that message in the tail of the test.
-rw-r--r--test/simple_ha_SUITE.erl21
1 files changed, 16 insertions, 5 deletions
diff --git a/test/simple_ha_SUITE.erl b/test/simple_ha_SUITE.erl
index 567f43fe67..7cf21a92eb 100644
--- a/test/simple_ha_SUITE.erl
+++ b/test/simple_ha_SUITE.erl
@@ -280,12 +280,23 @@ rejects_survive(Config, DeathFun) ->
durable = true,
arguments = [{<<"x-max-length">>, long, 1},
{<<"x-overflow">>, longstr, XOverflow}]}),
- Payload = <<"there can be only one">>,
- amqp_channel:call(Node1Channel,
- #'basic.publish'{routing_key = Queue},
- #amqp_msg{payload = Payload}),
- %% send a bunch of messages from the producer. Tolerating nacks.
+ amqp_channel:register_confirm_handler(Node1Channel, self()),
+ #'confirm.select_ok'{} = amqp_channel:call(Node1Channel, #'confirm.select'{}),
+
+ Payload = <<"there can be only one">>,
+ 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. They should all be nacked, as the queue is full.
ProducerPid = rabbit_ha_test_producer:create(Node2Channel, Queue,
self(), true, Msgs, nacks),
DeathFun(Config, A),