From 6bdbcf3588abe6858361adbd3f3e5484b07f80c2 Mon Sep 17 00:00:00 2001 From: Sergey Skripnick Date: Mon, 4 Apr 2016 11:50:03 +0300 Subject: [PATCH] Remove hardcode from heat service Also create timeout was increased, and heat job will be more stable. Change-Id: Ib569166830463b97e485024af5127a4005f5f530 --- rally/plugins/openstack/services/heat/main.py | 7 +++++-- tests/unit/plugins/openstack/services/heat/test_main.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rally/plugins/openstack/services/heat/main.py b/rally/plugins/openstack/services/heat/main.py index 10862cfb09..6a7671599c 100644 --- a/rally/plugins/openstack/services/heat/main.py +++ b/rally/plugins/openstack/services/heat/main.py @@ -11,11 +11,14 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_config import cfg from rally.common import utils as common_utils from rally.task import atomic from rally.task import utils +CONF = cfg.CONF + class Stack(common_utils.RandomNameGeneratorMixin): """Represent heat stack. @@ -48,8 +51,8 @@ class Stack(common_utils.RandomNameGeneratorMixin): def _wait(self, ready_statuses, failure_statuses): self.stack = utils.wait_for_status( self.stack, - check_interval=10, - timeout=1200, + check_interval=CONF.benchmark.heat_stack_create_poll_interval, + timeout=CONF.benchmark.heat_stack_create_timeout, ready_statuses=ready_statuses, failure_statuses=failure_statuses, update_resource=utils.get_from_manager(), diff --git a/tests/unit/plugins/openstack/services/heat/test_main.py b/tests/unit/plugins/openstack/services/heat/test_main.py index 75f887fd7e..f8f4a8e511 100644 --- a/tests/unit/plugins/openstack/services/heat/test_main.py +++ b/tests/unit/plugins/openstack/services/heat/test_main.py @@ -48,10 +48,10 @@ class StackTestCase(test.ScenarioTestCase): stack.stack = fake_stack = mock.Mock() stack._wait(["ready_statuses"], ["failure_statuses"]) mock_utils.wait_for_status.assert_called_once_with( - fake_stack, check_interval=10, + fake_stack, check_interval=1.0, ready_statuses=["ready_statuses"], failure_statuses=["failure_statuses"], - timeout=1200, + timeout=3600.0, update_resource=mock_utils.get_from_manager()) @mock.patch("rally.task.atomic")