From cf9eeb1a4ef60c224995849ed0d1fad9d8ccf184 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Fri, 9 Jun 2017 14:15:45 +0200 Subject: [PATCH] Fix slow test_connect_volume_device_not_valid test This test unnecessarily takes 6 seconds to execute so this patch reduces this time to 0.0000 seconds. We have to mock `eventlet.greenthread.sleep` instead of `time.sleep` because that's what is directly being used in oslo_service's loopingcall. TrivialFix Change-Id: I239cfa5dbaccf5648b732d6c414792b8497acc19 --- os_brick/tests/initiator/connectors/test_fibre_channel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/os_brick/tests/initiator/connectors/test_fibre_channel.py b/os_brick/tests/initiator/connectors/test_fibre_channel.py index 1b18633..916a9bd 100644 --- a/os_brick/tests/initiator/connectors/test_fibre_channel.py +++ b/os_brick/tests/initiator/connectors/test_fibre_channel.py @@ -417,6 +417,7 @@ class FibreChannelConnectorTestCase(test_connector.ConnectorTestCase): actual = self.connector.get_all_available_volumes() self.assertItemsEqual(expected, actual) + @mock.patch('eventlet.greenthread.sleep', mock.Mock()) @mock.patch.object(linuxscsi.LinuxSCSI, 'find_multipath_device') @mock.patch.object(linuxscsi.LinuxSCSI, 'wait_for_rw') @mock.patch.object(os.path, 'exists', return_value=True)