Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions oslo/messaging/_drivers/impl_rabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@
'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 '
Expand Down
7 changes: 6 additions & 1 deletion tests/drivers/test_impl_rabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def test_driver_load(self):

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.'
Expand Down Expand Up @@ -154,7 +159,7 @@ def test_driver_load(self, connection_klass, fake_ensure):
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):
Expand Down