From 00caf0a5a5e0704fe3530865b759e6cbae2febeb Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Fri, 1 Jul 2022 02:21:34 +0530 Subject: [PATCH] Fix "test_share_server_migration" sporadic failure The test in question kicks off the second phase of share server migration (migration complete). When the task state of the destination server changes to "migration_success", it checks if the source server has been deleted. The problem is that the deletion isn't instantaneous [1]. So, lets wait for the cleanup rather than expect to not find the source share server as soon as the migration is completed. [1] https://opendev.org/openstack/manila/src/commit/5866dadd4b1ddcd935c854b3190e6df5e12ac4e4/manila/share/manager.py#L5658-L5674 Change-Id: I385d0bf4b16083d9630969319ecc752681e8fe87 Signed-off-by: Goutham Pacha Ravi --- manilaclient/tests/functional/test_share_servers.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/manilaclient/tests/functional/test_share_servers.py b/manilaclient/tests/functional/test_share_servers.py index e709dcc59..e71ac00d2 100644 --- a/manilaclient/tests/functional/test_share_servers.py +++ b/manilaclient/tests/functional/test_share_servers.py @@ -331,9 +331,8 @@ class ShareServersMigrationBase(base.BaseTestCase): share_server_id) server = self.admin_client.wait_for_server_migration_task_state( dest_share_server_id, dest_host, task_state) - self.assertRaises(exceptions.NotFound, - self.admin_client.get_share_server, - share_server_id) + + self.admin_client.wait_for_share_server_deletion(share_server_id) else: self.admin_client.share_server_migration_cancel(server['id']) task_state = constants.TASK_STATE_MIGRATION_CANCELLED