diff options
author | Kenneth Giusti <kgiusti@gmail.com> | 2017-07-28 14:08:32 -0400 |
---|---|---|
committer | ChangBo Guo(gcb) <glongwave@gmail.com> | 2017-08-04 01:57:19 +0000 |
commit | 32b001fe9936cbe8b3c1ec6ba9eb3bd73231471a (patch) | |
tree | 8e12245336e5bb13527519f902401770427aa455 | |
parent | a931af6fd5b5242796239e6134fff3ea608c9280 (diff) | |
download | oslo-messaging-32b001fe9936cbe8b3c1ec6ba9eb3bd73231471a.tar.gz |
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
(cherry picked from commit 2c9ac202ebeaf0fca3316a3231d75d86718a97cf)
-rw-r--r-- | oslo_messaging/tests/drivers/test_impl_rabbit.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index e9e42b1..94be527 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) |