From a10b2f717a0948d16d9cf495e99fae3223012101 Mon Sep 17 00:00:00 2001 From: Matus Valo Date: Sun, 24 May 2020 23:27:21 +0200 Subject: Revert "Raise RecoverableConnectionError in maybe_declare with retry on and dropped connection" This reverts commit 90f51bcbbd32146998e7c7e4491150344343776b. --- kombu/common.py | 4 ---- t/unit/test_common.py | 15 --------------- 2 files changed, 19 deletions(-) diff --git a/kombu/common.py b/kombu/common.py index 8c2c847d..30abe1c6 100644 --- a/kombu/common.py +++ b/kombu/common.py @@ -168,10 +168,6 @@ def _maybe_declare(entity, channel): def _imaybe_declare(entity, channel, **retry_policy): _ensure_channel_is_bound(entity, channel) - - if not channel.connection: - raise RecoverableConnectionError('channel disconnected') - return entity.channel.connection.client.ensure( entity, _maybe_declare, **retry_policy)(entity, channel) diff --git a/t/unit/test_common.py b/t/unit/test_common.py index 42fac679..2f2874fb 100644 --- a/t/unit/test_common.py +++ b/t/unit/test_common.py @@ -198,21 +198,6 @@ class test_maybe_declare: # Then: the connection client used ensure to ensure the retry policy assert channel.connection.client.ensure.call_count - def test_with_retry_dropped_connection(self): - # Given: A mock Channel and mock entity - channel = self._get_mock_channel() - # Given: A mock Entity that is already bound - entity = self._get_mock_entity( - is_bound=True, can_cache_declaration=True) - entity.channel = channel - assert entity.is_bound, "Expected entity is bound to begin this test." - # When: Entity channel connection has gone away - entity.channel.connection = None - # When: calling maybe_declare with retry - # Then: the RecoverableConnectionError should be raised - with pytest.raises(RecoverableConnectionError): - maybe_declare(entity, channel, retry=True) - class test_replies: -- cgit v1.2.1