@@ -18,7 +18,8 @@ groups() ->
18
18
[
19
19
{parallel_tests , [parallel ], [
20
20
{overflow_reject_publish_dlx , [parallel ], OverflowTests },
21
- {overflow_reject_publish , [parallel ], OverflowTests }
21
+ {overflow_reject_publish , [parallel ], OverflowTests },
22
+ dead_queue_rejects
22
23
]}
23
24
].
24
25
@@ -62,7 +63,8 @@ init_per_testcase(policy_resets_to_default = Testcase, Config) ->
62
63
rabbit_ct_helpers :testcase_started (
63
64
rabbit_ct_helpers :set_config (Config , [{conn , Conn }]), Testcase );
64
65
init_per_testcase (Testcase , Config )
65
- when Testcase == confirms_rejects_conflict ->
66
+ when Testcase == confirms_rejects_conflict ;
67
+ Testcase == dead_queue_rejects ->
66
68
Conn = rabbit_ct_client_helpers :open_unmanaged_connection (Config ),
67
69
Conn1 = rabbit_ct_client_helpers :open_unmanaged_connection (Config ),
68
70
@@ -87,6 +89,10 @@ end_per_testcase(confirms_rejects_conflict = Testcase, Config) ->
87
89
XOverflow = ? config (overflow , Config ),
88
90
QueueName = <<" confirms_rejects_conflict" , " _" , XOverflow /binary >>,
89
91
amqp_channel :call (Ch , # 'queue.delete' {queue = QueueName }),
92
+ end_per_testcase0 (Testcase , Config );
93
+ end_per_testcase (dead_queue_rejects = Testcase , Config ) ->
94
+ {_ , Ch } = rabbit_ct_client_helpers :open_connection_and_channel (Config , 0 ),
95
+ amqp_channel :call (Ch , # 'queue.delete' {queue = <<" dead_queue_rejects" >>}),
90
96
end_per_testcase0 (Testcase , Config ).
91
97
92
98
end_per_testcase0 (Testcase , Config ) ->
@@ -102,6 +108,37 @@ end_per_testcase0(Testcase, Config) ->
102
108
103
109
rabbit_ct_helpers :testcase_finished (Config , Testcase ).
104
110
111
+ dead_queue_rejects (Config ) ->
112
+ Conn = ? config (conn , Config ),
113
+ {ok , Ch } = amqp_connection :open_channel (Conn ),
114
+ QueueName = <<" dead_queue_rejects" >>,
115
+ amqp_channel :call (Ch , # 'confirm.select' {}),
116
+ amqp_channel :register_confirm_handler (Ch , self ()),
117
+
118
+ amqp_channel :call (Ch , # 'queue.declare' {queue = QueueName ,
119
+ durable = true }),
120
+
121
+ amqp_channel :call (Ch , # 'basic.publish' {routing_key = QueueName },
122
+ # amqp_msg {payload = <<" HI" >>}),
123
+
124
+ receive
125
+ {'basic.ack' ,_ ,_ } -> ok
126
+ after 10000 ->
127
+ error (timeout_waiting_for_initial_ack )
128
+ end ,
129
+
130
+ kill_the_queue (QueueName , Config ),
131
+
132
+ amqp_channel :cast (Ch , # 'basic.publish' {routing_key = QueueName },
133
+ # amqp_msg {payload = <<" HI" >>}),
134
+
135
+ receive
136
+ {'basic.ack' ,_ ,_ } -> error (expecting_nack_got_ack );
137
+ {'basic.nack' ,_ ,_ ,_ } -> ok
138
+ after 10000 ->
139
+ error (timeout_waiting_for_nack )
140
+ end .
141
+
105
142
confirms_rejects_conflict (Config ) ->
106
143
Conn = ? config (conn , Config ),
107
144
Conn1 = ? config (conn1 , Config ),
@@ -284,7 +321,7 @@ clean_acks_mailbox() ->
284
321
end .
285
322
286
323
kill_the_queue (QueueName , Config ) ->
287
- rabbit_ct_broker_helpers :rpc (Config , 0 , ? MODULE , kill_the_queue , [QueueName ]).
324
+ ok = rabbit_ct_broker_helpers :rpc (Config , 0 , ? MODULE , kill_the_queue , [QueueName ]).
288
325
289
326
kill_the_queue (QueueName ) ->
290
327
[begin
@@ -300,8 +337,3 @@ kill_the_queue(QueueName) ->
300
337
true -> kill_the_queue (QueueName );
301
338
false -> ok
302
339
end .
303
-
304
-
305
-
306
-
307
-
0 commit comments