Merge "Always call TaskRunner._sleep()"

This commit is contained in:
Jenkins 2016-07-20 14:16:59 +00:00 committed by Gerrit Code Review
commit c9c29d5f23
2 changed files with 5 additions and 4 deletions

View File

@ -166,8 +166,8 @@ class TaskRunner(object):
self.start(timeout=timeout)
# ensure that zero second sleep is applied only if task
# has not completed.
if not self.done() and wait_time:
self._sleep(0)
if not self.done():
self._sleep(0 if wait_time is not None else None)
self.run_to_completion(wait_time=wait_time)
def start(self, timeout=None):
@ -420,7 +420,8 @@ class DependencyTaskGroup(object):
if not r:
del self._graph[k]
yield
if self._graph:
yield
for k, r in self._running():
if r.step():

View File

@ -854,7 +854,7 @@ class StackUpdateTest(common.HeatTestCase):
tmpl2 = {'HeatTemplateFormatVersion': '2012-12-12',
'Resources': {
'AResource': {'Type': 'GenericResourceType'},
'BResource': {'Type': 'GenericResourceType'}}}
'BResource': {'Type': 'MultiStepResourceType'}}}
updated_stack = stack.Stack(self.ctx, 'updated_stack',
template.Template(tmpl2),
disable_rollback=disable_rollback)