]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Speedup solidfire unit tests
authorjohn-griffith <john.griffith@solidfire.com>
Wed, 20 Mar 2013 18:24:36 +0000 (12:24 -0600)
committerjohn-griffith <john.griffith@solidfire.com>
Wed, 20 Mar 2013 18:28:49 +0000 (12:28 -0600)
The SolidFire driver has a sleep that's used in a retry loop.  This
sleep was being called every iteration of the loop though
(instead of just when the call failed).

This made SolidFire the slowest test in the unit tests, and obviously
it's just stupid anyway.  So this change fixes that and only performs
the sleep if the call actually failed.

Change-Id: I560f2fdb6bf16a6a9b26184234225349ab62e816

cinder/volume/drivers/solidfire.py

index 0b7966cbf08f070abbfac435f7f4ad9e943f8473..3f6f21641e18de4a65179893675d1b7e8b3026ba 100644 (file)
@@ -267,7 +267,8 @@ class SolidFire(SanISCSIDriver):
                     iqn = v['iqn']
                     found_volume = True
                     break
-            time.sleep(2)
+            if not found_volume:
+                time.sleep(2)
             iteration_count += 1
 
         if not found_volume: