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/
This commit is contained in:
Tetsuro Nakamura 2019-01-27 13:27:03 +00:00 committed by Pierre Riteau
parent d1d4a15d27
commit 73ab5dbf98
1 changed files with 4 additions and 0 deletions

View File

@ -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')