Merge "Retrigger new traversals after resource timeout"
This commit is contained in:
commit
7858ae0a85
@ -151,11 +151,8 @@ class CheckResource(object):
|
|||||||
self._handle_resource_failure(cnxt, is_update, rsrc.id,
|
self._handle_resource_failure(cnxt, is_update, rsrc.id,
|
||||||
stack, reason)
|
stack, reason)
|
||||||
except scheduler.Timeout:
|
except scheduler.Timeout:
|
||||||
# reload the stack to verify current traversal
|
self._handle_resource_failure(cnxt, is_update, rsrc.id,
|
||||||
stack = parser.Stack.load(cnxt, stack_id=stack.id)
|
stack, u'Timed out')
|
||||||
if stack.current_traversal != current_traversal:
|
|
||||||
return
|
|
||||||
self._handle_stack_timeout(cnxt, stack)
|
|
||||||
except CancelOperation:
|
except CancelOperation:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -476,15 +476,15 @@ class CheckWorkflowUpdateTest(common.HeatTestCase):
|
|||||||
mock_hf.assert_called_once_with(self.ctx, self.stack, u'Timed out')
|
mock_hf.assert_called_once_with(self.ctx, self.stack, u'Timed out')
|
||||||
|
|
||||||
@mock.patch.object(check_resource.CheckResource,
|
@mock.patch.object(check_resource.CheckResource,
|
||||||
'_handle_stack_timeout')
|
'_handle_failure')
|
||||||
def test_do_check_resource_marks_stack_as_failed_if_stack_timesout(
|
def test_do_check_resource_marks_stack_as_failed_if_stack_timesout(
|
||||||
self, mock_hst, mock_cru, mock_crc, mock_pcr, mock_csc):
|
self, mock_hf, mock_cru, mock_crc, mock_pcr, mock_csc):
|
||||||
mock_cru.side_effect = scheduler.Timeout(None, 60)
|
mock_cru.side_effect = scheduler.Timeout(None, 60)
|
||||||
self.is_update = True
|
self.is_update = True
|
||||||
self.cr._do_check_resource(self.ctx, self.stack.current_traversal,
|
self.cr._do_check_resource(self.ctx, self.stack.current_traversal,
|
||||||
self.stack.t, {}, self.is_update,
|
self.stack.t, {}, self.is_update,
|
||||||
self.resource, self.stack, {})
|
self.resource, self.stack, {})
|
||||||
mock_hst.assert_called_once_with(self.ctx, self.stack)
|
mock_hf.assert_called_once_with(self.ctx, self.stack, u'Timed out')
|
||||||
|
|
||||||
@mock.patch.object(check_resource.CheckResource,
|
@mock.patch.object(check_resource.CheckResource,
|
||||||
'_handle_stack_timeout')
|
'_handle_stack_timeout')
|
||||||
|
@ -81,3 +81,13 @@ class SimultaneousUpdateStackTest(functional_base.FunctionalTestsBase):
|
|||||||
time.sleep(10)
|
time.sleep(10)
|
||||||
|
|
||||||
self.update_stack(stack_id, after)
|
self.update_stack(stack_id, after)
|
||||||
|
|
||||||
|
@test.requires_convergence
|
||||||
|
def test_retrigger_timeout(self):
|
||||||
|
before, after = get_templates(delay_s=70)
|
||||||
|
stack_id = self.stack_create(template=before,
|
||||||
|
expected_status='CREATE_IN_PROGRESS',
|
||||||
|
timeout=1)
|
||||||
|
time.sleep(50)
|
||||||
|
|
||||||
|
self.update_stack(stack_id, after)
|
||||||
|
Loading…
Reference in New Issue
Block a user