Splitting executions into different tables
* Having different types of execution objects in different tables will give less contention on DB tables and hence better performance so DB schema was changed accordingly * Fixed all unit tests and places in the code where we assumed polymorphic access to execution objects * Other minor fixes TODO(in upcoming patches): * DB migration script Change-Id: Ibc8408e12dd85e143302d7fdddace32954551ac5
This commit is contained in:
@@ -96,7 +96,7 @@ class DirectWorkflowControllerTest(base.DbTestCase):
|
||||
|
||||
get_task_execution.return_value = task1_ex
|
||||
|
||||
task1_ex.executions.append(
|
||||
task1_ex.action_executions.append(
|
||||
models.ActionExecution(
|
||||
name='std.echo',
|
||||
workflow_name='wf',
|
||||
@@ -119,7 +119,7 @@ class DirectWorkflowControllerTest(base.DbTestCase):
|
||||
|
||||
# Now assume that 'task2' completed successfully.
|
||||
task2_ex = self._create_task_execution('task2', states.SUCCESS)
|
||||
task2_ex.executions.append(
|
||||
task2_ex.action_executions.append(
|
||||
models.ActionExecution(
|
||||
name='std.echo',
|
||||
workflow_name='wf',
|
||||
|
||||
@@ -31,17 +31,21 @@ class WithItemsTest(base.BaseTest):
|
||||
def test_get_indices(self):
|
||||
# Task execution for running 6 items with concurrency=3.
|
||||
task_ex = models.TaskExecution(
|
||||
spec={
|
||||
'action': 'myaction'
|
||||
},
|
||||
runtime_context={
|
||||
'with_items_context': {
|
||||
'capacity': 3,
|
||||
'count': 6
|
||||
}
|
||||
},
|
||||
executions=[]
|
||||
action_executions=[],
|
||||
workflow_executions=[]
|
||||
)
|
||||
|
||||
# Set 3 items: 2 success and 1 error unaccepted.
|
||||
task_ex.executions += [
|
||||
task_ex.action_executions += [
|
||||
self.get_action_ex(True, states.SUCCESS, 0),
|
||||
self.get_action_ex(True, states.SUCCESS, 1),
|
||||
self.get_action_ex(False, states.ERROR, 2)
|
||||
|
||||
Reference in New Issue
Block a user