From 2c9ac202ebeaf0fca3316a3231d75d86718a97cf Mon Sep 17 00:00:00 2001 From: Kenneth Giusti Date: Fri, 28 Jul 2017 14:08:32 -0400 Subject: [PATCH] Remove the test that counts kombu connect calls This test removes a check of the number of times kombu's Connection.connect() method is being called for each mocked retry. The number of calls kombu makes internally is irrelevant to proving the API is correct. The rest of the tests do ensure that the target method is retried as expected, which is relevant to the API. This change is necessary due to the kombu v4.1.0 release actually calling Connection.connect() twice for each call to the target method when compaired to earlier releases. Change-Id: I3326b8e92efe3bef00b1f389d81944af9cc080f8 Closes-Bug: #1707263 --- oslo_messaging/tests/drivers/test_impl_rabbit.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index e9e42b1c3..94be527b6 100644 --- a/oslo_messaging/tests/drivers/test_impl_rabbit.py +++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py @@ -961,10 +961,8 @@ class RpcKombuHATestCase(test_utils.BaseTestCase): url = oslo_messaging.TransportURL.parse(self.conf, None) self.connection = rabbit_driver.Connection(self.conf, url, driver_common.PURPOSE_SEND) - self.kombu_connect = mock.Mock() self.useFixture(fixtures.MockPatch( - 'kombu.connection.Connection.connect', - side_effect=self.kombu_connect)) + 'kombu.connection.Connection.connect')) self.addCleanup(self.connection.close) def test_ensure_four_retry(self): @@ -972,7 +970,6 @@ class RpcKombuHATestCase(test_utils.BaseTestCase): self.assertRaises(oslo_messaging.MessageDeliveryFailure, self.connection.ensure, mock_callback, retry=4) - self.assertEqual(5, self.kombu_connect.call_count) self.assertEqual(6, mock_callback.call_count) def test_ensure_one_retry(self): @@ -980,7 +977,6 @@ class RpcKombuHATestCase(test_utils.BaseTestCase): self.assertRaises(oslo_messaging.MessageDeliveryFailure, self.connection.ensure, mock_callback, retry=1) - self.assertEqual(2, self.kombu_connect.call_count) self.assertEqual(3, mock_callback.call_count) def test_ensure_no_retry(self): @@ -988,7 +984,6 @@ class RpcKombuHATestCase(test_utils.BaseTestCase): self.assertRaises(oslo_messaging.MessageDeliveryFailure, self.connection.ensure, mock_callback, retry=0) - self.assertEqual(1, self.kombu_connect.call_count) self.assertEqual(2, mock_callback.call_count)