Mock time.sleep for test_lv_deactivate_timeout test

Test local_dev.test_brick_lvm.BrickLvmTestCase.test_lv_deactivate_timeout
doesn't mock time.sleep which is used for retries.

It increases test execution time to ~2s instead of ~0.02.

Change-Id: Id3704d90de0b3d04401c0b7b7686470685dbc1cc
Closes-Bug: #1620986
This commit is contained in:
Ivan Kolodyazhny 2016-09-07 12:46:28 +03:00
parent 3818f0f4dd
commit c2968770a5
1 changed files with 2 additions and 1 deletions

View File

@ -373,7 +373,8 @@ class BrickLvmTestCase(base.TestCase):
self.vg.create_volume('test', '1G')
self.vg.deactivate_lv('test')
def test_lv_deactivate_timeout(self):
@mock.patch('time.sleep')
def test_lv_deactivate_timeout(self, mock_sleep):
with mock.patch.object(self.vg, '_execute'):
is_active_mock = mock.Mock()
is_active_mock.return_value = True