Fix 2 races conditions in mistral CI
We recently had two issues in CI, this commit tries to fix them. Closes-Bug: #2051040 Change-Id: I05d850344c653bc858b4565673606531da803342 Signed-off-by: Arnaud M <arnaud.morin@gmail.com>
This commit is contained in:
parent
0b7c4cd0f6
commit
9b7218e358
|
@ -1502,10 +1502,15 @@ class PoliciesTest(base.EngineTestCase):
|
|||
|
||||
task_ex = wf_ex.task_executions[0]
|
||||
|
||||
self.assertEqual(states.IDLE, task_ex.state)
|
||||
|
||||
# NOTE(amorin) we used to test the task state here
|
||||
# but this is not possible because we cannot be sure the task is
|
||||
# actually IDLE, RUNNING or even ERROR (because it's suppose to fail)
|
||||
# It depends on the server load / latency
|
||||
# So now, we will only await for it to be in error
|
||||
# See lp-2051040
|
||||
self.await_task_error(task_ex.id)
|
||||
|
||||
# And workflow
|
||||
self.await_workflow_error(wf_ex.id)
|
||||
|
||||
# Wait until timeout exceeds.
|
||||
|
|
|
@ -905,6 +905,11 @@ class SubworkflowPauseResumeTest(base.EngineTestCase):
|
|||
wf_1_task_1_action_exs[0].id
|
||||
)
|
||||
|
||||
# NOTE(amorin) we need to await the wf to make sure it's actually
|
||||
# running and avoid race condition with IDLE state
|
||||
# See lp-2051040
|
||||
self.await_workflow_state(wf_2_ex_1.id, states.RUNNING)
|
||||
|
||||
wf_2_ex_1_task_execs = wf_2_ex_1.task_executions
|
||||
|
||||
wf_2_ex_1_task_1_ex = self._assert_single_item(
|
||||
|
@ -912,6 +917,9 @@ class SubworkflowPauseResumeTest(base.EngineTestCase):
|
|||
name='task1'
|
||||
)
|
||||
|
||||
# We also need to wait for the task to be RUNNING
|
||||
self.await_task_running(wf_2_ex_1_task_1_ex.id)
|
||||
|
||||
wf_2_ex_1_task_1_action_exs = db_api.get_action_executions(
|
||||
task_execution_id=wf_2_ex_1_task_1_ex.id
|
||||
)
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -38,6 +38,13 @@ allowlist_externals =
|
|||
bash
|
||||
commands = bash run_tests.sh -N --db-type postgresql
|
||||
|
||||
[testenv:unit-sqlite]
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
passenv = ZUUL_PROJECT
|
||||
allowlist_externals =
|
||||
bash
|
||||
commands = bash run_tests.sh -N --db-type sqlite
|
||||
|
||||
[testenv:unit-mysql]
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
passenv = ZUUL_PROJECT
|
||||
|
|
Loading…
Reference in New Issue