summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Piwowarski <lpiwowar@redhat.com>2023-02-28 15:11:43 +0000
committerLukas Piwowarski <lpiwowar@redhat.com>2023-03-03 08:07:42 +0000
commitd78e405364ca3725820fc7bd4b2f2af198ccc624 (patch)
tree5f37325270eacbf3524067b6032e909af6102c11
parent4c76f1642f6cd2147ceb9a7bea2a27f7a22038cb (diff)
downloadtempest-d78e405364ca3725820fc7bd4b2f2af198ccc624.tar.gz
Fix server cleanup in test_multiple_create test
The above-mentioned test uses ServersClient.delete_server function to delete servers. However, this function does not wait for the successful deletion of the servers which sometimes leads to an error (see linked bug). This patch changes the test so that it uses BaseV2ComputeTest.delete_server function which waits for the successful deletion of the server. Closes-Bug: #1954535 Change-Id: Ic1ed48fda03ce3c13198d2dd299b57d68b06e63d
-rw-r--r--tempest/api/compute/servers/test_multiple_create.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tempest/api/compute/servers/test_multiple_create.py b/tempest/api/compute/servers/test_multiple_create.py
index 10c76bbfb..b464c45f5 100644
--- a/tempest/api/compute/servers/test_multiple_create.py
+++ b/tempest/api/compute/servers/test_multiple_create.py
@@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.common import compute
+from tempest.common import waiters
from tempest.lib import decorators
@@ -34,8 +35,15 @@ class MultipleCreateTestJSON(base.BaseV2ComputeTest):
wait_until='ACTIVE',
min_count=2,
tenant_network=tenant_network)
+
+ for server in servers:
+ self.addCleanup(waiters.wait_for_server_termination,
+ self.servers_client,
+ server['id'])
+
for server in servers:
self.addCleanup(self.servers_client.delete_server, server['id'])
+
# NOTE(maurosr): do status response check and also make sure that
# reservation_id is not in the response body when the request send
# contains return_reservation_id=False