Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
Description
The test_unbind_
{direct, topic, fanout, headers}tests all go through the method unbind_test, which declares two exclusive queues. Since they are exclusive, and not explicitly deleted after the test, the next such test can fail with a "405 RESOURCE_LOCKED".
In AMQP 0-9 the exclusive queues should be deleted when the connection is closed (which happens in TestBase.tearDown). I would prefer not to rely on this though, since there is a race between the server deleting the queue and the next test running.
The solution is to register the queues to be explicitly deleted after the test is run:
Index: tests_0-9/queue.py
===================================================================
— tests_0-9/queue.py (revision 822337)
+++ tests_0-9/queue.py (working copy)
@@ -40,8 +40,8 @@
#bind two queues and consume from them
channel = self.channel
- channel.queue_declare(queue="queue-1", exclusive="True")
- channel.queue_declare(queue="queue-2", exclusive="True")
+ self.queue_declare(queue="queue-1", exclusive="True")
+ self.queue_declare(queue="queue-2", exclusive="True")
channel.basic_consume(queue="queue-1", consumer_tag="queue-1",
no_ack=True)
channel.basic_consume(queue="queue-2", consumer_tag="queue-2",
no_ack=True)