Merge "ensure pipeline_listener set up"
This commit is contained in:
commit
2f88891d0e
@ -87,8 +87,8 @@ class BaseNotificationTest(tests_base.BaseTestCase):
|
|||||||
if srv.conf.notification.workload_partitioning:
|
if srv.conf.notification.workload_partitioning:
|
||||||
start = time.time()
|
start = time.time()
|
||||||
while time.time() - start < 10:
|
while time.time() - start < 10:
|
||||||
if srv.group_state: # ensure pipeline is set if HA
|
if srv.group_state and srv.pipeline_listener:
|
||||||
break
|
break # ensure pipeline is set if HA
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
else:
|
else:
|
||||||
self.fail('Did not start pipeline queues')
|
self.fail('Did not start pipeline queues')
|
||||||
@ -284,8 +284,7 @@ class TestRealNotificationHA(BaseRealNotification):
|
|||||||
self.srv._refresh_agent()
|
self.srv._refresh_agent()
|
||||||
self.assertIsNot(listener, self.srv.pipeline_listener)
|
self.assertIsNot(listener, self.srv.pipeline_listener)
|
||||||
|
|
||||||
@mock.patch('oslo_messaging.get_batch_notification_listener')
|
def test_hashring_targets(self):
|
||||||
def test_hashring_targets(self, mock_listener):
|
|
||||||
maybe = {"maybe": 0}
|
maybe = {"maybe": 0}
|
||||||
|
|
||||||
def _once_over_five(item):
|
def _once_over_five(item):
|
||||||
@ -297,7 +296,8 @@ class TestRealNotificationHA(BaseRealNotification):
|
|||||||
self.srv.partition_coordinator = pc = mock.MagicMock()
|
self.srv.partition_coordinator = pc = mock.MagicMock()
|
||||||
pc.join_partitioned_group.return_value = hashring
|
pc.join_partitioned_group.return_value = hashring
|
||||||
self.run_service(self.srv)
|
self.run_service(self.srv)
|
||||||
topics = [target.topic for target in mock_listener.call_args[0][1]]
|
topics = [target.topic for target in
|
||||||
|
self.srv.pipeline_listener.targets]
|
||||||
self.assertEqual(4, len(topics))
|
self.assertEqual(4, len(topics))
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
{'ceilometer_ipc-sample-4', 'ceilometer_ipc-sample-9',
|
{'ceilometer_ipc-sample-4', 'ceilometer_ipc-sample-9',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user