@@ -36,7 +36,8 @@ groups() ->
36
36
restart_queue ,
37
37
restart_all_types ,
38
38
stop_start_rabbit_app ,
39
- publish_to_queue
39
+ publish_to_queue ,
40
+ publish_and_restart
40
41
]}
41
42
].
42
43
@@ -241,12 +242,28 @@ publish_to_queue(Config) ->
241
242
? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
242
243
declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
243
244
244
- ok = amqp_channel :call (Ch ,
245
- # 'basic.publish' {routing_key = QQ },
246
- # amqp_msg {props = # 'P_basic' {delivery_mode = 2 },
247
- payload = <<" msg" >>}),
245
+ publish (Ch , QQ ),
248
246
wait_for_messages (Config , 0 , QQ , <<" 1" >>).
249
247
248
+ publish_and_restart (Config ) ->
249
+ % % Test the node restart with both types of queues (quorum and classic) to
250
+ % % ensure there are no regressions
251
+ Node = rabbit_ct_broker_helpers :get_node_config (Config , 0 , nodename ),
252
+
253
+ Ch = rabbit_ct_client_helpers :open_channel (Config , Node ),
254
+ QQ = <<" quorum-q1" >>,
255
+ ? assertEqual ({'queue.declare_ok' , QQ , 0 , 0 },
256
+ declare (Ch , QQ , [{<<" x-queue-type" >>, longstr , <<" quorum" >>}])),
257
+ publish (Ch , QQ ),
258
+ wait_for_messages (Config , 0 , QQ , <<" 1" >>),
259
+
260
+ ok = rabbit_ct_broker_helpers :stop_node (Config , Node ),
261
+ ok = rabbit_ct_broker_helpers :start_node (Config , Node ),
262
+
263
+ wait_for_messages (Config , 0 , QQ , <<" 1" >>),
264
+ publish (rabbit_ct_client_helpers :open_channel (Config , Node ), QQ ),
265
+ wait_for_messages (Config , 0 , QQ , <<" 2" >>).
266
+
250
267
% %----------------------------------------------------------------------------
251
268
252
269
declare (Ch , Q ) ->
@@ -283,3 +300,9 @@ wait_for_messages(Config, Node, Queue, Count, N) ->
283
300
timer :sleep (500 ),
284
301
wait_for_messages (Config , Node , Queue , Count , N - 1 )
285
302
end .
303
+
304
+ publish (Ch , Queue ) ->
305
+ ok = amqp_channel :call (Ch ,
306
+ # 'basic.publish' {routing_key = Queue },
307
+ # amqp_msg {props = # 'P_basic' {delivery_mode = 2 },
308
+ payload = <<" msg" >>}).
0 commit comments