summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <sfinucan@redhat.com>2020-07-01 15:01:00 +0100
committerJan Zerebecki <jan.openstack@zerebecki.de>2020-07-23 08:09:47 +0000
commit6727be7890f64446f1658d79fac196d30b6f1a18 (patch)
tree33a1abc794dc2b440b89e955fa04a7b37bfbb134
parentdfcc4b0010d39d1f16be413bb1c3a4808718cd19 (diff)
downloadoslo-messaging-12.1.2.tar.gz
tests: Resolves issues with kombu > 4.6.812.1.2
The 'kombu.connection.Connection.ensure_connection' method has changed from calling 'retry_over_time' on 'self.connect' to calling it on 'self._connection_factory' [1], meaning our mocks are outdated. Address this change. [1] https://github.com/celery/kombu/pull/1193/commits/398aa5b8cd1fe1fc Change-Id: Ibbcf21a57ab1e3f90c21901296e5c088b645127c Signed-off-by: Stephen Finucane <sfinucan@redhat.com> Closes-Bug: #1885923 (cherry picked from commit afb035d97185fa9c622bdb9b4c31c71f01160370)
-rw-r--r--oslo_messaging/tests/drivers/test_impl_rabbit.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py
index 9212196..39a90a0 100644
--- a/oslo_messaging/tests/drivers/test_impl_rabbit.py
+++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py
@@ -21,6 +21,7 @@ import uuid
import fixtures
import kombu
+import kombu.connection
import kombu.transport.memory
from oslo_serialization import jsonutils
from oslo_utils import eventletutils
@@ -972,13 +973,19 @@ class RpcKombuHATestCase(test_utils.BaseTestCase):
'kombu.connection.Connection.connection'))
self.useFixture(fixtures.MockPatch(
'kombu.connection.Connection.channel'))
+ # TODO(stephenfin): Drop hasattr when we drop support for kombo < 4.6.8
+ if hasattr(kombu.connection.Connection, '_connection_factory'):
+ self.useFixture(fixtures.MockPatch(
+ 'kombu.connection.Connection._connection_factory'))
# starting from the first broker in the list
url = oslo_messaging.TransportURL.parse(self.conf, None)
self.connection = rabbit_driver.Connection(self.conf, url,
driver_common.PURPOSE_SEND)
- self.useFixture(fixtures.MockPatch(
- 'kombu.connection.Connection.connect'))
+ # TODO(stephenfin): Remove when we drop support for kombo < 4.6.8
+ if hasattr(kombu.connection.Connection, 'connect'):
+ self.useFixture(fixtures.MockPatch(
+ 'kombu.connection.Connection.connect'))
self.addCleanup(self.connection.close)
def test_ensure_four_retry(self):