Merge "Tests: Fix racy volume unit test"
This commit is contained in:
commit
e6642d97fd
@ -1161,7 +1161,13 @@ class VolumeTestCase(BaseVolumeTestCase):
|
|||||||
db.volume_update(self.context, volume['id'], {'status': 'available'})
|
db.volume_update(self.context, volume['id'], {'status': 'available'})
|
||||||
self.volume_api.delete(self.context, volume)
|
self.volume_api.delete(self.context, volume)
|
||||||
|
|
||||||
volume = db.volume_get(self.context, volume['id'])
|
volume = objects.Volume.get_by_id(self.context, volume.id)
|
||||||
|
while volume.status == 'available':
|
||||||
|
# Must wait for volume_api delete request to process enough to
|
||||||
|
# change the volume status.
|
||||||
|
time.sleep(0.5)
|
||||||
|
volume.refresh()
|
||||||
|
|
||||||
self.assertEqual('deleting', volume['status'])
|
self.assertEqual('deleting', volume['status'])
|
||||||
|
|
||||||
db.volume_destroy(self.context, volume['id'])
|
db.volume_destroy(self.context, volume['id'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user