From 73ab5dbf98f844f153ee887dfc5513b573e7147a Mon Sep 17 00:00:00 2001 From: Tetsuro Nakamura Date: Sun, 27 Jan 2019 13:27:03 +0000 Subject: [PATCH] Wait before lease status transition Supporting placement API, on reservation end, there could be a time lag between the server deletion and the lease status transition. This change inserts a waiting function before checking the lease status. Change-Id: Ia39a8691f799ac3cd654a0af5f1930eb58093a0d Needed-By: https://review.openstack.org/#/c/633203/ --- .../tests/scenario/test_instance_reservation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blazar_tempest_plugin/tests/scenario/test_instance_reservation.py b/blazar_tempest_plugin/tests/scenario/test_instance_reservation.py index 4b9d84f..96c2151 100644 --- a/blazar_tempest_plugin/tests/scenario/test_instance_reservation.py +++ b/blazar_tempest_plugin/tests/scenario/test_instance_reservation.py @@ -210,6 +210,10 @@ class TestInstanceReservationScenario(rrs.ResourceReservationScenarioTest): waiters.wait_for_server_termination(self.os_admin.servers_client, server['id']) + # There is a lag between the server termination and the lease status + # transition. Let's wait a bit here. + self.wait_for_lease_end(lease['id']) + # check the lease status and reservation status lease = self.reservation_client.get_lease(lease['id'])['lease'] self.assertTrue(lease['status'] == 'TERMINATED')