Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manan164 committed Jun 11, 2024
1 parent 135837a commit d481f6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
then: "verify that the 'integration_task_1' was polled and acknowledged"
verifyPolledAndAcknowledgedTask(pollAndCompleteTask)

when: "the subworkflow task should be in SCHEDULED state and is started by issuing a system task call"
List<String> polledTaskIds = queueDAO.pop("SUB_WORKFLOW", 1, 200)
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])

then: "verify that the 'sub_workflow_task' is in a IN_PROGRESS state"
def rootWorkflowInstance = workflowExecutionService.getExecutionStatus(rootWorkflowId, true)
with(rootWorkflowInstance) {
Expand Down Expand Up @@ -336,7 +332,7 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification {
}

when: "the SUB_WORKFLOW task in mid level workflow is started by issuing a system task call"
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(1).subWorkflowId
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(4).subWorkflowId

then: "verify that a new leaf workflow is created and is in RUNNING state"
newLeafWorkflowId != leafWorkflowId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import com.netflix.conductor.test.base.AbstractSpecification

import spock.lang.Shared

import static com.netflix.conductor.common.metadata.tasks.TaskType.SUB_WORKFLOW
import static com.netflix.conductor.common.metadata.tasks.TaskType.TASK_TYPE_SUB_WORKFLOW
import static com.netflix.conductor.test.util.WorkflowTestUtil.verifyPolledAndAcknowledgedTask

Expand Down Expand Up @@ -201,24 +202,17 @@ class SubWorkflowRetrySpec extends AbstractSpecification {
tasks[2].status == Task.Status.IN_PROGRESS
tasks[2].retriedTaskId == tasks[1].taskId
}
def newMidLevelWorkflowId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTasks().get(1).subWorkflowId
def newMidLevelWorkflowId = workflowExecutionService.getExecutionStatus(rootWorkflowId, true).getTasks().get(2).subWorkflowId

then: "verify that a new mid level workflow is created and is in RUNNING state"
newMidLevelWorkflowId != midLevelWorkflowId
with(workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true)) {
status == Workflow.WorkflowStatus.RUNNING
tasks.size() == 1
tasks[0].taskType == 'integration_task_1'
tasks[0].status == Task.Status.SCHEDULED
tasks.size() == 2
tasks[1].taskType == TASK_TYPE_SUB_WORKFLOW
tasks[1].status == Task.Status.IN_PROGRESS
}

when: "poll and complete the integration_task_1 task in the mid-level workflow"
workflowTestUtil.pollAndCompleteTask('integration_task_1', 'task1.integration.worker', ['op': 'task1.done'])

and: "poll and execute the sub workflow task"
polledTaskIds = queueDAO.pop(TASK_TYPE_SUB_WORKFLOW, 1, 200)
asyncSystemTaskExecutor.execute(subWorkflowTask, polledTaskIds[0])
def newLeafWorkflowId = workflowExecutionService.getTask(polledTaskIds[0]).subWorkflowId
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(newMidLevelWorkflowId, true).getTasks().get(1).subWorkflowId

then: "verify that a new leaf workflow is created and is in RUNNING state"
newLeafWorkflowId != leafWorkflowId
Expand Down Expand Up @@ -415,7 +409,7 @@ class SubWorkflowRetrySpec extends AbstractSpecification {
tasks[1].status == Task.Status.IN_PROGRESS
tasks[1].subworkflowChanged
}
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(1).subWorkflowId
def newLeafWorkflowId = workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true).getTasks().get(2).subWorkflowId

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

0 comments on commit d481f6c

Please sign in to comment.