summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephenfin@redhat.com>2020-11-12 11:45:20 +0000
committerStephen Finucane <stephenfin@redhat.com>2020-11-12 19:41:27 +0000
commit1d23b358d6b3ecef1561c196270243654618b005 (patch)
tree1c3030347cd6979cb44db943b6483cc6b1c95681
parentdc93e3b510f53d5b2198c8edd22528f0c899617e (diff)
downloadnova-1d23b358d6b3ecef1561c196270243654618b005.tar.gz
functional: Wait for revert resize to complete
When reverting a resize, we need to wait for the migration status to change to 'reverted', but we also need to wait for the relevant versioned notification to be emitted. The reason for this is noted in a couple of places, including the '_revert_resize' helper in the 'nova.tests.functional.integrated_helpers.InstanceHelperMixin' module: [T]he migration status is changed to "reverted" in the dest host revert_resize method but the allocations are cleaned up in the source host finish_revert_resize method so we need to wait for the finish_revert_resize method to complete. Two tests in the 'test_cross_cell_migrate' test module were not doing this wait, resulting in intermittent failures in CI due to the races. Resolve this now. Change-Id: I3ec6cae19b362ac9cc311a979f680cf64db4f458 Signed-off-by: Stephen Finucane <stephenfin@redhat.com> Closes-Bug: #1904051
-rw-r--r--nova/tests/functional/test_cross_cell_migrate.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/tests/functional/test_cross_cell_migrate.py b/nova/tests/functional/test_cross_cell_migrate.py
index 97dbb10390..268c9e74ee 100644
--- a/nova/tests/functional/test_cross_cell_migrate.py
+++ b/nova/tests/functional/test_cross_cell_migrate.py
@@ -800,6 +800,8 @@ class TestMultiCellMigrate(integrated_helpers.ProviderUsageBaseTestCase):
self.api.post_server_action(server['id'], {'revertResize': None})
server = self._wait_for_state_change(server, 'ACTIVE')
self._wait_for_migration_status(server, ['reverted'])
+ fake_notifier.wait_for_versioned_notifications(
+ 'instance.resize_revert.end')
self.assert_volume_is_detached(server['id'], uuids.fake_volume_id)
# Delete the server and make sure we did not leak anything.
self.delete_server_and_assert_cleanup(server)
@@ -1070,6 +1072,8 @@ class TestMultiCellMigrate(integrated_helpers.ProviderUsageBaseTestCase):
self.assertEqual(4, server['OS-EXT-STS:power_state'],
"Unexpected power state after revertResize.")
self._wait_for_migration_status(server, ['reverted'])
+ fake_notifier.wait_for_versioned_notifications(
+ 'instance.resize_revert.end')
# Now try cold-migrating to cell2 to make sure there is no
# duplicate entry error in the DB.