From 25a778cb0b03b07aa93213c55e9d2b81d4dba260 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Tue, 13 Jun 2017 13:00:33 +0300 Subject: [PATCH] Mock time.sleep for VMAXRestTest.test_remove_vol_from_sg_failed We don't need sleeps in unit tests. This patch makes test ten times faster Change-Id: Icd37566120f3ee4802240a279cf5ceca89be2dc6 --- cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py index 0abcb29e158..dca2edd0070 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py @@ -17,6 +17,7 @@ import ast from copy import deepcopy import datetime import tempfile +import time from xml.dom import minidom import mock @@ -1218,7 +1219,8 @@ class VMAXRestTest(test.TestCase): self.rest.wait_for_job.assert_called_with( operation, status_code, message, self.data.extra_specs) - def test_remove_vol_from_sg_failed(self): + @mock.patch.object(time, 'sleep') + def test_remove_vol_from_sg_failed(self, mock_sleep): device_id = [self.data.volume_details[0]['volumeId']] self.assertRaises( exception.VolumeBackendAPIException,