diff options
author | Matus Valo <matusvalo@users.noreply.github.com> | 2020-05-24 23:27:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 23:27:21 +0200 |
commit | a10b2f717a0948d16d9cf495e99fae3223012101 (patch) | |
tree | 5c3247bfa4616a91ce2204dec0643f26cf40521d | |
parent | 91d4ef0a1d1158d2b3b2801f0e27db0bb67a2521 (diff) | |
download | kombu-revert-1171-fix_conn_imaybe_declare.tar.gz |
Revert "Raise RecoverableConnectionError in maybe_declare with retry on and dropped connection"revert-1171-fix_conn_imaybe_declare
This reverts commit 90f51bcbbd32146998e7c7e4491150344343776b.
-rw-r--r-- | kombu/common.py | 4 | ||||
-rw-r--r-- | t/unit/test_common.py | 15 |
2 files changed, 0 insertions, 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: |