diff --git a/oslo_messaging/_drivers/impl_rabbit.py b/oslo_messaging/_drivers/impl_rabbit.py index 45fed1c24..ee2da428e 100644 --- a/oslo_messaging/_drivers/impl_rabbit.py +++ b/oslo_messaging/_drivers/impl_rabbit.py @@ -123,10 +123,10 @@ rabbit_opts = [ 'If you change this option, you must wipe the ' 'RabbitMQ database.'), cfg.IntOpt('heartbeat_timeout_threshold', - default=60, + default=0, help="Number of seconds after which the Rabbit broker is " "considered down if heartbeat's keep-alive fails " - "(0 disable the heartbeat)."), + "(0 disable the heartbeat). EXPERIMENTAL"), cfg.IntOpt('heartbeat_rate', default=2, help='How often times during the heartbeat_timeout_threshold ' diff --git a/oslo_messaging/tests/drivers/test_impl_rabbit.py b/oslo_messaging/tests/drivers/test_impl_rabbit.py index 2187d70b8..5805c5e71 100644 --- a/oslo_messaging/tests/drivers/test_impl_rabbit.py +++ b/oslo_messaging/tests/drivers/test_impl_rabbit.py @@ -58,6 +58,12 @@ class TestDeprecatedRabbitDriverLoad(test_utils.BaseTestCase): class TestHeartbeat(test_utils.BaseTestCase): + def setUp(self): + super(TestHeartbeat, self).setUp( + conf=cfg.ConfigOpts()) + self.config(heartbeat_timeout_threshold=60, + group='oslo_messaging_rabbit') + @mock.patch('oslo_messaging._drivers.impl_rabbit.LOG') @mock.patch('kombu.connection.Connection.heartbeat_check') @mock.patch('oslo_messaging._drivers.impl_rabbit.Connection.' @@ -164,7 +170,7 @@ class TestRabbitDriverLoadSSL(test_utils.BaseTestCase): transport._driver._get_connection() connection_klass.assert_called_once_with( 'memory:///', ssl=self.expected, login_method='AMQPLAIN', - heartbeat=60, failover_strategy="shuffle") + heartbeat=0, failover_strategy="shuffle") class TestRabbitIterconsume(test_utils.BaseTestCase):