From 005d8413398af9abde201f902d37c3c862f10bb5 Mon Sep 17 00:00:00 2001 From: Yuriy Zveryanskyy Date: Mon, 11 Aug 2014 14:54:05 +0300 Subject: [PATCH] Reduce running time of test_different_sizes Unit test test_different_sizes from RealFilePartitioningTestCase tests 26 variants of partitions sizes and applies each of them to a file, therefore running time of this test more than 30s. This patch reduce variants to some "typical", running time now about 5s. Change-Id: I072666009f4ecca51e84a6dc71257d725aaf2f42 --- ironic/tests/drivers/test_deploy_utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ironic/tests/drivers/test_deploy_utils.py b/ironic/tests/drivers/test_deploy_utils.py index 559fbb381c..c84b8a6f68 100644 --- a/ironic/tests/drivers/test_deploy_utils.py +++ b/ironic/tests/drivers/test_deploy_utils.py @@ -15,7 +15,6 @@ # under the License. import fixtures -import itertools import mock import os import tempfile @@ -687,10 +686,8 @@ class RealFilePartitioningTestCase(tests_base.TestCase): def test_different_sizes(self): # NOTE(dtantsur): Keep this list in order with expected partitioning fields = ['ephemeral_mb', 'swap_mb', 'root_mb'] - variants = itertools.product([0, 1, 5], repeat=3) + variants = ((0, 0, 12), (4, 2, 8), (0, 4, 10), (5, 0, 10)) for variant in variants: - if variant == (0, 0, 0): - continue kwargs = dict(zip(fields, variant)) self._run_without_root(utils.work_on_disk, self.file.name, ephemeral_format='ext4', node_uuid='',