def test_stack_create_timeout(self):

    def dummy_task():
        while True:
            (yield)
    self.patchobject(scheduler.DependencyTaskGroup, '__call__', return_value=dummy_task())
    stk = stack.Stack(self.ctx, 's', self.tmpl)
    start_time = time.time()
    self.patchobject(timeutils, 'wallclock', side_effect=[start_time, (start_time + 1), ((start_time + stk.timeout_secs()) + 1)])
    stk.create()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.FAILED), stk.state)
    self.assertEqual('Create timed out', stk.status_reason)
    self.assertEqual(3, timeutils.wallclock.call_count)
def test_stack_create_timeout(self):

    def dummy_task():
        while True:
            (yield)
    self.patchobject(scheduler.DependencyTaskGroup, '__call__', return_value=dummy_task())
    stk = stack.Stack(self.ctx, 's', self.tmpl)
    start_time = time.time()
    self.patchobject(timeutils, 'wallclock', side_effect=[start_time, (start_time + 1), ((start_time + stk.timeout_secs()) + 1)])
    stk.create()
    self.assertEqual((stack.Stack.CREATE, stack.Stack.FAILED), stk.state)
    self.assertEqual('Create timed out', stk.status_reason)
    self.assertEqual(3, timeutils.wallclock.call_count)