Skip to content

Commit fcae736

Browse files
committed
Improving confirms test stability and error reporting
Add process messages to the error message. Try harder to kill queues.
1 parent eab9304 commit fcae736

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

test/confirms_rejects_SUITE.erl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ mixed_dead_alive_queues_reject(Config) ->
161161
{'basic.ack',_,_} -> ok;
162162
{'basic.nack',_,_,_} -> error(expecting_ack_got_nack)
163163
after 50000 ->
164-
error(timeout_waiting_for_initial_ack)
164+
error({timeout_waiting_for_initial_ack, process_info(self(), messages)})
165165
end,
166166

167167
kill_the_queue(QueueNameDead, Config),
@@ -174,7 +174,7 @@ mixed_dead_alive_queues_reject(Config) ->
174174
{'basic.nack',_,_,_} -> ok;
175175
{'basic.ack',_,_} -> error(expecting_nack_got_ack)
176176
after 50000 ->
177-
error(timeout_waiting_for_ack)
177+
error({timeout_waiting_for_nack, process_info(self(), messages)})
178178
end.
179179

180180
confirms_rejects_conflict(Config) ->
@@ -365,7 +365,14 @@ kill_the_queue(QueueName) ->
365365
Pid = amqqueue:get_pid(Q),
366366
exit(Pid, kill)
367367
end
368-
|| _ <- lists:seq(1, 11)].
368+
|| _ <- lists:seq(1, 11)],
369+
{ok, Q} = rabbit_amqqueue:lookup({resource, <<"/">>, queue, QueueName}),
370+
Pid = amqqueue:get_pid(Q),
371+
case is_process_alive(Pid) of
372+
%% Try to kill it again
373+
true -> kill_the_queue(QueueName);
374+
false -> ok
375+
end.
369376

370377

371378

0 commit comments

Comments
 (0)