Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
JetDrag committed Apr 21, 2024
1 parent ca25386 commit 10f18eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions dramatiq/brokers/rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ def enqueue(self, message, *, delay=None):
# next caller/attempt may initiate new ones of each.
del self.connection

if isinstance(e, ChannelClosedByBroker) and e.reply_code == 404 and \
e.reply_text.startswith("NOT_FOUND - no queue"):
if isinstance(e, ChannelClosedByBroker) and e.reply_code == 404:
self.queues_pending.add(queue_name(queue_name))
raise ConnectionClosed(e) from None

Expand Down
3 changes: 1 addition & 2 deletions tests/test_rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,7 @@ def do_work():
rabbitmq_broker.channel.queue_declare(do_work.queue_name, passive=True)
# Let the queue go unexpectedly
rabbitmq_broker.channel.queue_delete(do_work.queue_name)
with pytest.raises(pika.exceptions.ChannelClosedByBroker):
rabbitmq_broker.channel.queue_declare(do_work.queue_name, passive=True)
rabbitmq_broker.channel.queue_declare(do_work.queue_name, passive=True)

# And I send that actor a message
do_work.send()
Expand Down

0 comments on commit 10f18eb

Please sign in to comment.