From c586d0886ad4b239831a0b4a1827a8b4d054c120 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 10 Sep 2019 13:43:42 -0400 Subject: [PATCH] Fix up test_snapshot notify tests Search for notify calls in a way that ignores extra notifications. Change-Id: I90cbfdaad582900f3047acffbfcdd3189335ffbf Partial-Bug: #1803648 --- cinder/tests/unit/volume/test_snapshot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cinder/tests/unit/volume/test_snapshot.py b/cinder/tests/unit/volume/test_snapshot.py index 7e951bec4a7..bd942a42e52 100644 --- a/cinder/tests/unit/volume/test_snapshot.py +++ b/cinder/tests/unit/volume/test_snapshot.py @@ -118,7 +118,8 @@ class SnapshotTestCase(base.BaseVolumeTestCase): self.assert_notify_called(mock_notify, (['INFO', 'volume.create.start'], - ['INFO', 'volume.create.end'])) + ['INFO', 'volume.create.end']), + any_order=True) snapshot = create_snapshot(volume['id'], size=volume['size']) snapshot_id = snapshot.id @@ -131,7 +132,8 @@ class SnapshotTestCase(base.BaseVolumeTestCase): (['INFO', 'volume.create.start'], ['INFO', 'volume.create.end'], ['INFO', 'snapshot.create.start'], - ['INFO', 'snapshot.create.end'])) + ['INFO', 'snapshot.create.end']), + any_order=True) self.volume.delete_snapshot(self.context, snapshot) self.assert_notify_called(mock_notify, @@ -140,7 +142,8 @@ class SnapshotTestCase(base.BaseVolumeTestCase): ['INFO', 'snapshot.create.start'], ['INFO', 'snapshot.create.end'], ['INFO', 'snapshot.delete.start'], - ['INFO', 'snapshot.delete.end'])) + ['INFO', 'snapshot.delete.end']), + any_order=True) snap = objects.Snapshot.get_by_id(context.get_admin_context( read_deleted='yes'), snapshot_id)