@@ -39,7 +39,8 @@ groups() ->
39
39
publish_to_queue ,
40
40
publish_and_restart ,
41
41
consume_from_queue ,
42
- consume_from_empty_queue
42
+ consume_from_empty_queue ,
43
+ consume_and_autoack_from_queue
43
44
]}
44
45
].
45
46
@@ -278,11 +279,28 @@ consume_from_queue(Config) ->
278
279
279
280
publish (Ch , QQ ),
280
281
wait_for_messages (Config , 0 , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>),
281
- consume (Ch , QQ ),
282
+ consume (Ch , QQ , true ),
282
283
wait_for_messages (Config , 0 , QQ , <<" 1" >>, <<" 0" >>, <<" 1" >>),
283
284
rabbit_ct_client_helpers :close_channel (Ch ),
284
285
wait_for_messages (Config , 0 , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>).
285
286
287
+ consume_and_autoack_from_queue (Config ) ->
288
+ % % Test the node restart with both types of queues (quorum and classic) to
289
+ % % ensure there are no regressions
290
+ Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
291
+
292
+ Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
293
+ QQ = <<" quorum-q" >>,
294
+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
295
+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
296
+
297
+ publish (Ch , QQ ),
298
+ wait_for_messages (Config , 0 , QQ , <<" 1" >>, <<" 1" >>, <<" 0" >>),
299
+ consume (Ch , QQ , false ),
300
+ wait_for_messages (Config , 0 , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>),
301
+ rabbit_ct_client_helpers :close_channel (Ch ),
302
+ wait_for_messages (Config , 0 , QQ , <<" 0" >>, <<" 0" >>, <<" 0" >>).
303
+
286
304
consume_from_empty_queue (Config ) ->
287
305
% % Test the node restart with both types of queues (quorum and classic) to
288
306
% % ensure there are no regressions
@@ -293,7 +311,7 @@ consume_from_empty_queue(Config) ->
293
311
? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
294
312
declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
295
313
296
- consume_empty (Ch , QQ ).
314
+ consume_empty (Ch , QQ , true ).
297
315
298
316
% %----------------------------------------------------------------------------
299
317
@@ -340,12 +358,12 @@ publish(Ch, Queue) ->
340
358
# amqp_msg {props = # 'P_basic' {delivery_mode = 2 },
341
359
payload = <<" msg" >>}).
342
360
343
- consume (Ch , Queue ) ->
361
+ consume (Ch , Queue , NoAck ) ->
344
362
? assertMatch ({# 'basic.get_ok' {}, # amqp_msg {payload = <<" msg" >>}},
345
363
amqp_channel :call (Ch , # 'basic.get' {queue = Queue ,
346
- no_ack = true })).
364
+ no_ack = NoAck })).
347
365
348
- consume_empty (Ch , Queue ) ->
366
+ consume_empty (Ch , Queue , NoAck ) ->
349
367
? assertMatch (# 'basic.get_empty' {},
350
368
amqp_channel :call (Ch , # 'basic.get' {queue = Queue ,
351
- no_ack = true })).
369
+ no_ack = NoAck })).
0 commit comments