aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2019-01-29 18:15:23 +0000
committerEmma Foley <emma.l.foley@intel.com>2019-01-31 12:09:32 +0000
commit1342ab2acfbdeb39fd7aaeda7455ba6c16ad9095 (patch)
tree26570e7114080402d76bbf666c59817b2cf9c068 /yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py
parentdfb534bbd7ab1454c1ad3b63d0b785e3050c1962 (diff)
Mock time.sleep in slow tests
time.sleep was called in a number of classes which wasn't mocked in the tests. This accounted for 2.5 minutes of UT execution time. The calls to time.sleep() have been mocked, and the test execution time has been reduced. JIRA: YARDSTICK-1595 Change-Id: I0a4f4962513cf8845471b074347601e33b35ef25 Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py')
-rw-r--r--yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py b/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py
index 11bee03a4..2660d4134 100644
--- a/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py
+++ b/yardstick/tests/unit/network_services/traffic_profile/test_prox_profile.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+import time
import unittest
import mock
@@ -78,7 +79,8 @@ class TestProxProfile(unittest.TestCase):
profile.init(queue)
self.assertIs(profile.queue, queue)
- def test_execute_traffic(self):
+ @mock.patch.object(time, 'sleep')
+ def test_execute_traffic(self, *args):
packet_sizes = [
10,
100,