Merge "Fix test not waiting for action to be created"
This commit is contained in:
commit
7baff017d0
@ -199,6 +199,11 @@ class EngineTestCase(base.DbTestCase):
|
||||
def is_action_in_state(self, ex_id, state):
|
||||
return db_api.get_action_execution(ex_id).state == state
|
||||
|
||||
def is_action_created(self, task_ex_id):
|
||||
return bool(db_api.get_action_executions(
|
||||
task_execution_id=task_ex_id
|
||||
))
|
||||
|
||||
def await_action_state(self, ex_id, state, delay=DEFAULT_DELAY,
|
||||
timeout=DEFAULT_TIMEOUT):
|
||||
self._await(
|
||||
@ -274,6 +279,14 @@ class EngineTestCase(base.DbTestCase):
|
||||
timeout=DEFAULT_TIMEOUT):
|
||||
self._await(lambda: self.is_task_processed(ex_id), delay, timeout)
|
||||
|
||||
def await_task_creates_action(self, ex_id, delay=DEFAULT_DELAY,
|
||||
timeout=DEFAULT_TIMEOUT):
|
||||
self._await(
|
||||
lambda: self.is_action_created(ex_id),
|
||||
delay,
|
||||
timeout
|
||||
)
|
||||
|
||||
# Various methods for workflow execution objects.
|
||||
|
||||
def is_workflow_in_state(self, ex_id, state):
|
||||
|
@ -181,6 +181,7 @@ class TaskCancelTest(base.EngineTestCase):
|
||||
name='task1'
|
||||
)
|
||||
|
||||
self.await_task_creates_action(task_1_ex.id)
|
||||
task_1_action_exs = db_api.get_action_executions(
|
||||
task_execution_id=task_1_ex.id
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user