From 540bbce0bbc82b71ace58472c2775381e1df49aa Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:52:25 +0530 Subject: [PATCH 1/2] Sub workflow sync test fix. Since the ordering of the task can be different. The integration_task_2 will be polled and completed. --- .../HierarchicalForkJoinSubworkflowRetrySpec.groovy | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 c272e8637..916c34be8 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 @@ -93,10 +93,10 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification { tasks[3].status == Task.Status.IN_PROGRESS } - when: "poll and complete the integration_task_1 task" + when: "poll and complete the integration_task_2 task" def pollAndCompleteTask = workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done']) - then: "verify that the 'integration_task_1' was polled and acknowledged" + then: "verify that the 'integration_task_2' was polled and acknowledged" verifyPolledAndAcknowledgedTask(pollAndCompleteTask) then: "verify that the 'sub_workflow_task' is in a IN_PROGRESS state" @@ -106,6 +106,12 @@ class HierarchicalForkJoinSubworkflowRetrySpec extends AbstractSpecification { tasks.size() == 4 } + when: "poll and complete the integration_task_2 task" + pollAndCompleteTask = workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done']) + + then: "verify that the 'integration_task_2' was polled and acknowledged" + verifyPolledAndAcknowledgedTask(pollAndCompleteTask) + and: "verify that the mid-level workflow is RUNNING, and first task is in SCHEDULED state" midLevelWorkflowId = rootWorkflowInstance.tasks[1].subWorkflowId with(workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true)) { From e2000cfca766c93432c64e27e74b1e7bef5d7bf3 Mon Sep 17 00:00:00 2001 From: manan164 <1897158+manan164@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:09:13 +0530 Subject: [PATCH 2/2] added in other tests --- .../HierarchicalForkJoinSubworkflowRerunSpec.groovy | 6 ++++++ .../HierarchicalForkJoinSubworkflowRestartSpec.groovy | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRerunSpec.groovy b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRerunSpec.groovy index 21f582307..6152ce355 100644 --- a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRerunSpec.groovy +++ b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRerunSpec.groovy @@ -107,6 +107,12 @@ class HierarchicalForkJoinSubworkflowRerunSpec extends AbstractSpecification { tasks.size() == 4 } + when: "poll and complete the integration_task_2 task" + pollAndCompleteTask = workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done']) + + then: "verify that the 'integration_task_2' was polled and acknowledged" + verifyPolledAndAcknowledgedTask(pollAndCompleteTask) + and: "verify that the mid-level workflow is RUNNING, and first task is in SCHEDULED state" midLevelWorkflowId = rootWorkflowInstance.tasks[1].subWorkflowId with(workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true)) { diff --git a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRestartSpec.groovy b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRestartSpec.groovy index b490ba5c7..1d9cc0b11 100644 --- a/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRestartSpec.groovy +++ b/test-harness/src/test/groovy/com/netflix/conductor/test/integration/HierarchicalForkJoinSubworkflowRestartSpec.groovy @@ -110,6 +110,12 @@ class HierarchicalForkJoinSubworkflowRestartSpec extends AbstractSpecification { tasks.size() == 4 } + when: "poll and complete the integration_task_2 task" + pollAndCompleteTask = workflowTestUtil.pollAndCompleteTask('integration_task_2', 'task2.integration.worker', ['op': 'task2.done']) + + then: "verify that the 'integration_task_2' was polled and acknowledged" + verifyPolledAndAcknowledgedTask(pollAndCompleteTask) + and: "verify that the mid-level workflow is RUNNING, and first task is in SCHEDULED state" midLevelWorkflowId = rootWorkflowInstance.tasks[1].subWorkflowId with(workflowExecutionService.getExecutionStatus(midLevelWorkflowId, true)) {