Update volume detach smoke test to check status.
Updates test_007_me_can_detach_volume so that it waits for the volume status to become active for up to 10 seconds after initiating the command to detach the volume. Previously it just waited for 5 seconds without checking the status which can be problematic in that it causes the subsequent test to delete the volume to fail intermittently (because only active or error volumes can be deleted). I noticed this in SmokeStack because 2 days ago this commit landed: b46f224f7555e3065b0daacd101b65d86117f0c1 and it is now causing a fair amount of intermittent volume tests to fail for Nova and Cinder. Apparently now that we have ordered the commands to remove an iscsi target properly it takes a bit longer... Change-Id: Ibfd25af93f9cb063a76a04138b8d23d28a01b89a
This commit is contained in:
parent
b3cc1138cc
commit
c8416912d4
@ -308,7 +308,14 @@ class VolumeTests(base.UserSmokeTestCase):
|
||||
def test_007_me_can_detach_volume(self):
|
||||
result = self.conn.detach_volume(volume_id=self.data['volume'].id)
|
||||
self.assertTrue(result)
|
||||
time.sleep(5)
|
||||
volume = self.data['volume']
|
||||
for x in xrange(10):
|
||||
volume.update()
|
||||
if volume.status.startswith('available'):
|
||||
break
|
||||
time.sleep(1)
|
||||
else:
|
||||
self.fail('cannot detach volume. state %s' % volume.status)
|
||||
|
||||
def test_008_me_can_delete_volume(self):
|
||||
result = self.conn.delete_volume(self.data['volume'].id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user