From c3cd87a6ed74482c9871d3d61afccf88492c13c2 Mon Sep 17 00:00:00 2001 From: zhufl Date: Tue, 6 Aug 2019 11:26:57 +0800 Subject: [PATCH] Do not delete server when task state is image_snapshot test_delete_saving_image fails when deleting server while server is in task_state image_snapshot, so this is to wait for the server image-snapshotting to be finished before deleting the server. Change-Id: I09e0a796ede5509b84bd844488444d77f1763418 Closes-Bug: #1839048 --- tempest/api/compute/images/test_images.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tempest/api/compute/images/test_images.py b/tempest/api/compute/images/test_images.py index c8221c28d9..7cf26fb473 100644 --- a/tempest/api/compute/images/test_images.py +++ b/tempest/api/compute/images/test_images.py @@ -47,6 +47,10 @@ class ImagesTestJSON(base.BaseV2ComputeTest): def test_delete_saving_image(self): server = self.create_test_server(wait_until='ACTIVE') self.addCleanup(self.servers_client.delete_server, server['id']) + # wait for server active to avoid conflict when deleting server + # in task_state image_snapshot + self.addCleanup(waiters.wait_for_server_status, self.servers_client, + server['id'], 'ACTIVE') image = self.create_image_from_server(server['id'], wait_until='SAVING') self.client.delete_image(image['id'])