summaryrefslogtreecommitdiff
path: root/oslo_messaging/tests/notify/test_notifier.py
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_messaging/tests/notify/test_notifier.py')
-rw-r--r--oslo_messaging/tests/notify/test_notifier.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/oslo_messaging/tests/notify/test_notifier.py b/oslo_messaging/tests/notify/test_notifier.py
index d0a8eca..330bdab 100644
--- a/oslo_messaging/tests/notify/test_notifier.py
+++ b/oslo_messaging/tests/notify/test_notifier.py
@@ -244,6 +244,10 @@ class TestMessagingNotifierRetry(test_utils.BaseTestCase):
topics=["test-retry"],
retry=2,
group="oslo_messaging_notifications")
+ self.config(
+ # just to speed up the test execution
+ rabbit_retry_backoff=0,
+ group="oslo_messaging_rabbit")
transport = oslo_messaging.get_notification_transport(
self.conf, url='rabbit://')
notifier = oslo_messaging.Notifier(transport)
@@ -264,12 +268,15 @@ class TestMessagingNotifierRetry(test_utils.BaseTestCase):
'kombu.connection.Connection._establish_connection',
new=wrapped_establish_connection
):
- # FIXME(gibi) This is bug 1917645 as the driver does not stop
- # retrying the connection after two retries only our test fixture
- # stops the retry by raising TestingException
- self.assertRaises(
- self.TestingException,
- notifier.info, {}, "test", {})
+ with mock.patch(
+ 'oslo_messaging.notify.messaging.LOG.exception'
+ ) as mock_log:
+ notifier.info({}, "test", {})
+
+ # one normal call plus two retries
+ self.assertEqual(3, len(calls))
+ # the error was caught and logged
+ mock_log.assert_called_once()
def test_notifier_retry_connection_fails_kafka(self):
"""This test sets a small retry number for notification sending and