Tests : notifier problem with backup

There appears to be a race condition while sending notifications
to ceilometer with rpc.
the backup.createprogress notification seems to be leaking which
appears to be the main cause of the failures.
This patch addresses the issue.

Change-Id: I460a270eba61cdca131717f7dfe726841a509378
Closes-Bug: #1803648
This commit is contained in:
whoami-rajat 2018-11-19 09:24:01 +05:30 committed by Rajat Dhasmana
parent 4529b193da
commit a2b9d4dd9b
1 changed files with 3 additions and 3 deletions

View File

@ -432,7 +432,7 @@ class ChunkedDriverTestCase(test.TestCase):
self.assertEqual(50, obj_meta.get('backup_percent', 0))
self.assertTrue(mock_notify.called)
@mock.patch('cinder.volume.utils.notify_about_backup_usage')
@mock.patch('cinder.tests.unit.fake_notifier.FakeNotifier._notify')
def test_backup(self, mock_notify):
volume_file = mock.Mock()
volume_file.tell.side_effect = [0, len(TEST_DATA)]
@ -441,8 +441,8 @@ class ChunkedDriverTestCase(test.TestCase):
with mock.patch.object(self.driver, 'get_object_writer',
return_value=obj_writer):
self.driver.backup(self.backup, volume_file)
mock_notify.assert_called()
self.assert_notify_called(mock_notify,
(['INFO', 'backup.createprogress'],))
def test_backup_invalid_size(self):
self.driver.chunk_size_bytes = 999