On slow environments, time.sleep(10) is not enough for attach/detach API
calls to propage properly leading to failures like the following one
(reduced api_check test)
2018-01-31 18:53:19,297 - functest.ci.run_tests - INFO - Running test case 'api_check'...
2018-01-31 18:54:27,434 - functest.ci.run_tests - INFO - Test result:
+-------------------+------------------+------------------+----------------+
| TEST CASE | PROJECT | DURATION | RESULT |
+-------------------+------------------+------------------+----------------+
| api_check | functest | 01:07 | FAIL |
+-------------------+------------------+------------------+----------------+
We can workaround this by using the nova_utils.{de,at}tach_volume}
'timeout' argument to wait up to 2 minutes for the attach/detach call to
complete. This doesn't affect normal exception whilst it helps get the
test going on slow systems. WIth this change, the api_check (reduced
test) passes as follows:
2018-01-31 18:48:35,469 - functest.ci.run_tests - INFO - Running test case 'api_check'...
2018-01-31 18:50:56,705 - functest.ci.run_tests - INFO - Test result:
+-------------------+------------------+------------------+----------------+
| TEST CASE | PROJECT | DURATION | RESULT |
+-------------------+------------------+------------------+----------------+
| api_check | functest | 02:20 | PASS |
+-------------------+------------------+------------------+----------------+
Change-Id: I2245adb84d0e6d4e3350d17d0c2e44baf5202d51
Signed-off-by: Markos Chandras <mchandras@suse.de>
neutron = neutron_utils.neutron_client(self.os_creds)
nova_utils.attach_volume(
self.nova, neutron, self.instance_creator.get_vm_inst(),
neutron = neutron_utils.neutron_client(self.os_creds)
nova_utils.attach_volume(
self.nova, neutron, self.instance_creator.get_vm_inst(),
- self.volume_creator.get_volume())
-
- time.sleep(10)
+ self.volume_creator.get_volume(), 120)
vol_attach = cinder_utils.get_volume_by_id(
self.cinder, self.volume_creator.get_volume().id)
vol_attach = cinder_utils.get_volume_by_id(
self.cinder, self.volume_creator.get_volume().id)
# Detach volume to VM
nova_utils.detach_volume(
self.nova, neutron, self.instance_creator.get_vm_inst(),
# Detach volume to VM
nova_utils.detach_volume(
self.nova, neutron, self.instance_creator.get_vm_inst(),
- self.volume_creator.get_volume())
-
- time.sleep(10)
+ self.volume_creator.get_volume(), 120)
vol_detach = cinder_utils.get_volume_by_id(
self.cinder, self.volume_creator.get_volume().id)
vol_detach = cinder_utils.get_volume_by_id(
self.cinder, self.volume_creator.get_volume().id)