Leave more relevant comment in engine race condition test
* It still fails with SQLite in unit tests but not reproducible on MySql Change-Id: I499e5f953299eb81245a825b5fd4c8a71d793fe4
This commit is contained in:
parent
39e2b4a8d0
commit
b549137e97
@ -62,14 +62,14 @@ wf:
|
||||
The idea is to use action that runs faster than engine.start_workflow().
|
||||
And we need to check that engine handles this situation as well. This was
|
||||
a situation previously that led to a race condition in engine, method
|
||||
on_task_result() was called while DB transaction in start_workflow() was
|
||||
still active (not committed yet).
|
||||
on_action_complete() was called while DB transaction in start_workflow()
|
||||
was still active (not committed yet).
|
||||
To emulate a short action we use a workflow with two start tasks so they
|
||||
run both in parallel on the first engine iteration when we call method
|
||||
start_workflow(). First task has a short action that just returns a
|
||||
predefined result and the second task blocks until the test explicitly
|
||||
unblocks it. So the first action will always end before start_workflow()
|
||||
methods ends.
|
||||
method ends.
|
||||
|
||||
output:
|
||||
result: <% $.result %>
|
||||
@ -78,7 +78,7 @@ wf:
|
||||
task1:
|
||||
action: std.echo output=1
|
||||
publish:
|
||||
result: <% $.task1 %>
|
||||
result: <% task(task1).result %>
|
||||
|
||||
task2:
|
||||
action: test.block
|
||||
@ -112,9 +112,9 @@ class BlockingAction(action_base.Action):
|
||||
pass
|
||||
|
||||
|
||||
class LongActionTest(base.EngineTestCase):
|
||||
class EngineActionRaceConditionTest(base.EngineTestCase):
|
||||
def setUp(self):
|
||||
super(LongActionTest, self).setUp()
|
||||
super(EngineActionRaceConditionTest, self).setUp()
|
||||
|
||||
global ACTION_SEMAPHORE
|
||||
global TEST_SEMAPHORE
|
||||
@ -165,8 +165,10 @@ class LongActionTest(base.EngineTestCase):
|
||||
|
||||
self.assertDictEqual({'result': 'test'}, wf_ex.output)
|
||||
|
||||
# TODO(rakhmerov): Should periodically fail now. Fix race condition.
|
||||
@testtools.skip('Skip until the race condition is fixed.')
|
||||
# TODO(rakhmerov): Should periodically fail now because of poor
|
||||
# transaction isolation support in SQLite. Requires more research
|
||||
# to understand all the details. It's not reproducible on MySql.
|
||||
@testtools.skip('Skip until we know how to fix it with SQLite.')
|
||||
def test_short_action(self):
|
||||
wf_service.create_workflows(WF_SHORT_ACTION)
|
||||
|
||||
@ -187,7 +189,7 @@ class LongActionTest(base.EngineTestCase):
|
||||
state=states.RUNNING
|
||||
)
|
||||
|
||||
self.await_task_success(task1_ex.id)
|
||||
self.await_task_success(task1_ex.id, timeout=10)
|
||||
|
||||
self.unblock_action()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user