Skip to content

Commit 135837a

Browse files
committed
fixes
1 parent d4d1bb3 commit 135837a

File tree

6 files changed

+31
-87
lines changed

6 files changed

+31
-87
lines changed

test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRestartSpec.groovy

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
8686
tasks[0].taskType == TASK_TYPE_FORK
8787
tasks[0].status == Task.Status.COMPLETED
8888
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
89-
tasks[1].status == Task.Status.SCHEDULED
89+
tasks[1].status == Task.Status.IN_PROGRESS
9090
tasks[2].taskType == 'integration_task_2'
9191
tasks[2].status == Task.Status.SCHEDULED
9292
tasks[3].taskType == TASK_TYPE_JOIN
@@ -118,9 +118,9 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
118118
tasks[0].taskType == TASK_TYPE_FORK
119119
tasks[0].status == Task.Status.COMPLETED
120120
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
121-
tasks[1].status == Task.Status.SCHEDULED
121+
tasks[1].status == Task.Status.IN_PROGRESS
122122
tasks[2].taskType == 'integration_task_2'
123-
tasks[2].status == Task.Status.SCHEDULED
123+
tasks[2].status == Task.Status.COMPLETED
124124
tasks[3].taskType == TASK_TYPE_JOIN
125125
tasks[3].status == Task.Status.IN_PROGRESS
126126
}
@@ -218,7 +218,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
218218
tasks[0].taskType == TASK_TYPE_FORK
219219
tasks[0].status == Task.Status.COMPLETED
220220
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
221-
tasks[1].status == Task.Status.SCHEDULED
221+
tasks[1].status == Task.Status.IN_PROGRESS
222222
tasks[2].taskType == 'integration_task_2'
223223
tasks[2].status == Task.Status.SCHEDULED
224224
tasks[3].taskType == TASK_TYPE_JOIN
@@ -228,11 +228,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
228228
when: "poll and complete the integration_task_2 task in the root workflow"
229229
def rootJoinId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
230230
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
231-
232-
and: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
233-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
234-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
235-
def newMidLevelWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
231+
def newMidLevelWorkflowId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTasks().get(1).subWorkflowId
236232

237233
then: "verify that a new mid level workflow is created and is in RUNNING state"
238234
newMidLevelWorkflowId != midLevelWorkflowId
@@ -242,21 +238,17 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
242238
tasks[0].taskType == TASK_TYPE_FORK
243239
tasks[0].status == Task.Status.COMPLETED
244240
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
245-
tasks[1].status == Task.Status.SCHEDULED
241+
tasks[1].status == Task.Status.IN_PROGRESS
246242
tasks[2].taskType == 'integration_task_2'
247-
tasks[2].status == Task.Status.SCHEDULED
243+
tasks[2].status == Task.Status.COMPLETED
248244
tasks[3].taskType == TASK_TYPE_JOIN
249245
tasks[3].status == Task.Status.IN_PROGRESS
250246
}
251247

252248
when: "poll and complete the integration_task_2 task in the mid-level workflow"
253249
def midJoinId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
254250
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
255-
256-
and: "poll and execute the sub workflow task"
257-
polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
258-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
259-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
251+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTasks().get(1).subWorkflowId
260252

261253
then: "verify that a new leaf workflow is created and is in RUNNING state"
262254
newLeafWorkflowId != leafWorkflowId
@@ -318,7 +310,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
318310
tasks[0].taskType == TASK_TYPE_FORK
319311
tasks[0].status == Task.Status.COMPLETED
320312
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
321-
tasks[1].status == Task.Status.SCHEDULED
313+
tasks[1].status == Task.Status.IN_PROGRESS
322314
tasks[2].taskType == 'integration_task_2'
323315
tasks[2].status == Task.Status.SCHEDULED
324316
tasks[3].taskType == TASK_TYPE_JOIN
@@ -344,11 +336,7 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification {
344336
def midJoinId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
345337
def rootJoinId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
346338
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
347-
348-
and: "the SUB_WORKFLOW task in mid level workflow is started by issuing a system task call"
349-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
350-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
351-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
339+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(1).subWorkflowId
352340

353341
then: "verify that a new leaf workflow is created and is in RUNNING state"
354342
newLeafWorkflowId != leafWorkflowId

test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRetrySpec.groovy

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
8686
tasks[0].taskType == TASK_TYPE_FORK
8787
tasks[0].status == Task.Status.COMPLETED
8888
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
89-
tasks[1].status == Task.Status.SCHEDULED
89+
tasks[1].status == Task.Status.IN_PROGRESS
9090
tasks[2].taskType == 'integration_task_2'
9191
tasks[2].status == Task.Status.SCHEDULED
9292
tasks[3].taskType == TASK_TYPE_JOIN
@@ -118,19 +118,15 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
118118
tasks[0].taskType == TASK_TYPE_FORK
119119
tasks[0].status == Task.Status.COMPLETED
120120
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
121-
tasks[1].status == Task.Status.SCHEDULED
121+
tasks[1].status == Task.Status.IN_PROGRESS
122122
tasks[2].taskType == 'integration_task_2'
123-
tasks[2].status == Task.Status.SCHEDULED
123+
tasks[2].status == Task.Status.COMPLETED
124124
tasks[3].taskType == TASK_TYPE_JOIN
125125
tasks[3].status == Task.Status.IN_PROGRESS
126126
}
127127

128128
and: "poll and complete the integration_task_1 task in the mid-level workflow"
129129
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
130-
131-
when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
132-
polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
133-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
134130
def midLevelWorkflowInstance = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true)
135131

136132
then: "verify that the leaf workflow is RUNNING, and first task is in SCHEDULED state"
@@ -225,14 +221,12 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
225221
tasks[3].taskType == TASK_TYPE_JOIN
226222
tasks[3].status == Task.Status.IN_PROGRESS
227223
tasks[4].taskType == TASK_TYPE_SUB_WORKFLOW
228-
tasks[4].status == Task.Status.SCHEDULED
224+
tasks[4].status == Task.Status.IN_PROGRESS
229225
tasks[4].retriedTaskId == tasks[1].taskId
230226
}
231227

232228
when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
233-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
234-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
235-
def newMidLevelWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
229+
def newMidLevelWorkflowId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTasks().get(4).subWorkflowId
236230
def rootJoinId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
237231

238232
then: "verify that a new mid level workflow is created and is in RUNNING state"
@@ -243,7 +237,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
243237
tasks[0].taskType == TASK_TYPE_FORK
244238
tasks[0].status == Task.Status.COMPLETED
245239
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
246-
tasks[1].status == Task.Status.SCHEDULED
240+
tasks[1].status == Task.Status.IN_PROGRESS
247241
tasks[2].taskType == 'integration_task_2'
248242
tasks[2].status == Task.Status.SCHEDULED
249243
tasks[3].taskType == TASK_TYPE_JOIN
@@ -253,11 +247,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
253247
when: "poll and complete the integration_task_1 task in the mid-level workflow"
254248
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
255249
def midJoinId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTaskByRefName("fanouttask_join").taskId
256-
257-
and: "poll and execute the sub workflow task"
258-
polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
259-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
260-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
250+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTasks().get(1).subWorkflowId
261251

262252
then: "verify that a new leaf workflow is created and is in RUNNING state"
263253
newLeafWorkflowId != leafWorkflowId
@@ -326,7 +316,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
326316
tasks[3].taskType == TASK_TYPE_JOIN
327317
tasks[3].status == Task.Status.IN_PROGRESS
328318
tasks[4].taskType == TASK_TYPE_SUB_WORKFLOW
329-
tasks[4].status == Task.Status.SCHEDULED
319+
tasks[4].status == Task.Status.IN_PROGRESS
330320
tasks[4].retriedTaskId == tasks[1].taskId
331321
}
332322

@@ -346,9 +336,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
346336
}
347337

348338
when: "the SUB_WORKFLOW task in mid level workflow is started by issuing a system task call"
349-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
350-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
351-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
339+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(1).subWorkflowId
352340

353341
then: "verify that a new leaf workflow is created and is in RUNNING state"
354342
newLeafWorkflowId != leafWorkflowId

test-harness/src/test/groovy/com/netflix/conductor/test/integration/LambdaAndTerminateTaskSpec.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class LambdaAndTerminateTaskSpec extends AbstractSpecification {
139139
tasks[3].status == Task.Status.IN_PROGRESS
140140
tasks[3].taskType == 'JOIN'
141141
tasks[3].seq == 4
142-
tasks[4].status == Task.Status.SCHEDULED
142+
tasks[4].status == Task.Status.IN_PROGRESS
143143
tasks[4].taskType == 'SUB_WORKFLOW'
144144
tasks[4].seq == 5
145145
tasks[5].status == Task.Status.IN_PROGRESS
@@ -149,8 +149,6 @@ class LambdaAndTerminateTaskSpec extends AbstractSpecification {
149149

150150
when: "subworkflow is retrieved"
151151
def workflow = workflowExecutionService.getExecutionStatus(workflowInstanceId, true)
152-
def subWorkflowTaskId = workflow.getTaskByRefName("test_terminate_subworkflow").getTaskId()
153-
asyncSystemTaskExecutor.execute(subWorkflowTask, subWorkflowTaskId)
154152
workflow = workflowExecutionService.getExecutionStatus(workflowInstanceId, true)
155153
def subWorkflowId = workflow.getTaskByRefName("test_terminate_subworkflow").subWorkflowId
156154

test-harness/src/test/groovy/com/netflix/conductor/test/integration/NestedForkJoinSubWorkflowSpec.groovy

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
8686
tasks[1].taskType == TASK_TYPE_FORK
8787
tasks[1].status == Task.Status.COMPLETED
8888
tasks[2].taskType == TASK_TYPE_SUB_WORKFLOW
89-
tasks[2].status == Task.Status.SCHEDULED
89+
tasks[2].status == Task.Status.IN_PROGRESS
9090
tasks[3].taskType == 'integration_task_2'
9191
tasks[3].status == Task.Status.SCHEDULED
9292
tasks[4].taskType == TASK_TYPE_JOIN
@@ -101,10 +101,6 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
101101
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task1.integration.worker', ['op': 'task1.done'])
102102
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task1.integration.worker', ['op': 'task1.done'])
103103

104-
and: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
105-
List<String> polledTaskIds = queueDAO.pop("SUB_WORKFLOW", 1, 200)
106-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds.get(0))
107-
108104
then: "verify that the 'sub_workflow_task' is in a IN_PROGRESS state"
109105
def parentWorkflowInstance = workflowExecutionService.getExecutionStatus(parentWorkflowId, true)
110106
with(parentWorkflowInstance) {
@@ -314,7 +310,7 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
314310
tasks[1].taskType == TASK_TYPE_FORK
315311
tasks[1].status == Task.Status.COMPLETED
316312
tasks[2].taskType == TASK_TYPE_SUB_WORKFLOW
317-
tasks[2].status == Task.Status.SCHEDULED
313+
tasks[2].status == Task.Status.IN_PROGRESS
318314
tasks[3].taskType == 'integration_task_2'
319315
tasks[3].status == Task.Status.SCHEDULED
320316
tasks[4].taskType == TASK_TYPE_JOIN
@@ -326,8 +322,6 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
326322
}
327323

328324
when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
329-
List<String> polledTaskIds = queueDAO.pop("SUB_WORKFLOW", 1, 200)
330-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds.get(0))
331325
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
332326
workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done'])
333327
def workflow = workflowExecutionService.getExecutionStatus(parentWorkflowId, true)
@@ -444,14 +438,10 @@ class NestedForkJoinSubWorkflowSpec extends AbstractSpecification {
444438
tasks[6].taskType == TASK_TYPE_JOIN
445439
tasks[6].status == Task.Status.IN_PROGRESS
446440
tasks[7].taskType == TASK_TYPE_SUB_WORKFLOW
447-
tasks[7].status == Task.Status.SCHEDULED
441+
tasks[7].status == Task.Status.IN_PROGRESS
448442
tasks[7].retriedTaskId == tasks[2].taskId
449443
}
450444

451-
when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
452-
List<String> polledTaskIds = queueDAO.pop("SUB_WORKFLOW", 1, 200)
453-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds.get(0))
454-
455445
then: "verify that SUB_WORKFLOW task in in progress"
456446
def parentWorkflowInstance = workflowExecutionService.getExecutionStatus(parentWorkflowId, true)
457447
with(workflowExecutionService.getExecutionStatus(parentWorkflowId, true)) {

test-harness/src/test/groovy/com/netflix/conductor/test/integration/SubWorkflowRestartSpec.groovy

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,9 @@ class SubWorkflowRestartSpec extends AbstractSpecification {
200200
tasks[0].taskType == 'integration_task_1'
201201
tasks[0].status == Task.Status.COMPLETED
202202
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
203-
tasks[1].status == Task.Status.SCHEDULED
203+
tasks[1].status == Task.Status.IN_PROGRESS
204204
}
205-
206-
when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
207-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
208-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
209-
def newMidLevelWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
205+
def newMidLevelWorkflowId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTasks().get(1).subWorkflowId
210206

211207
then: "verify that a new mid level workflow is created and is in RUNNING state"
212208
newMidLevelWorkflowId != midLevelWorkflowId
@@ -219,11 +215,7 @@ class SubWorkflowRestartSpec extends AbstractSpecification {
219215

220216
when: "poll and complete the integration_task_1 task in the mid-level workflow"
221217
workflowTestUtil.pollAndCompleteTask('integration_task_1', 'task1.integration.worker', ['op': 'task1.done'])
222-
223-
and: "poll and execute the sub workflow task"
224-
polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
225-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
226-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
218+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTasks().get(1).subWorkflowId
227219

228220
then: "verify that a new leaf workflow is created and is in RUNNING state"
229221
newLeafWorkflowId != leafWorkflowId
@@ -307,11 +299,7 @@ class SubWorkflowRestartSpec extends AbstractSpecification {
307299

308300
when: "poll and complete the task in the mid level workflow"
309301
workflowTestUtil.pollAndCompleteTask('integration_task_1', 'task1.integration.worker', ['op': 'task1.done'])
310-
311-
and: "the SUB_WORKFLOW task in mid level workflow is started by issuing a system task call"
312-
def polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
313-
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
314-
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
302+
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(1).subWorkflowId
315303

316304
then: "verify that a new leaf workflow is created and is in RUNNING state"
317305
newLeafWorkflowId != leafWorkflowId

0 commit comments

Comments
 (0)