Skip to content

Commit a054973

Browse files
authored
Merge pull request #126 from cloudblue/bugfix/LITE-27014
LITE-27014 Correct handling of AssertionError on `produce` in RabbitMQ
2 parents 3ff5271 + e5b6342 commit a054973

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

dj_cqrs/transport/rabbit_mq.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def _produce_with_retries(cls, payload, retries):
113113
exceptions.ChannelError,
114114
exceptions.ReentrancyError,
115115
AMQPConnectorException,
116+
AssertionError,
116117
) as e:
117118
# in case of any error - close connection and try to reconnect
118119
cls.clean_connection()

integration_tests/rdbms.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ services:
3333
bash -c '
3434
dockerize -wait tcp://postgres:5432 -timeout 50s &&
3535
dockerize -wait tcp://mysql:3306 -timeout 50s &&
36-
pytest
36+
pytest -v
3737
'

requirements/dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Django>=3.2
1+
Django>=3.2,<4.2
22
pika>=1.0.0
33
kombu>=4.6
44
ujson>=5.4.0

tests/test_transport/test_rabbit_mq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def rabbit_transport(settings):
173173

174174

175175
@pytest.mark.parametrize(
176-
'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException),
176+
'exception', (AMQPError, ChannelError, ReentrancyError, AMQPConnectorException, AssertionError),
177177
)
178178
def test_produce_connection_error(exception, rabbit_transport, mocker, caplog):
179179
mocker.patch.object(RabbitMQTransport, '_get_producer_rmq_objects', side_effect=exception)

0 commit comments

Comments
 (0)