From d481f6c55d381d321bf5b72e428079f1d08d2b88 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Tue, 11 Jun 2024 19:40:43 +0530 Subject: [PATCH] fixes --- ...rchicalForkJoinSubworkflowRetrySpec.groovy | 6 +----- .../integration/SubWorkflowRetrySpec.groovy | 20 +++++++------------ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRetrySpec.groovy b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRetrySpec.groovy index c403b3a14..c272e8637 100644 --- a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRetrySpec.groovy +++ b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRetrySpec.groovy @@ -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 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) { @@ -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 diff --git a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/SubWorkflowRetrySpec.groovy b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/SubWorkflowRetrySpec.groovy index 99f882323..17907d407 100644 --- a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/SubWorkflowRetrySpec.groovy +++ b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/SubWorkflowRetrySpec.groovy @@ -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 @@ -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 @@ -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