From bdbea9cb69fab9aa8b580251cbbe3b69d4dc7603 Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Fri, 13 Sep 2024 14:56:31 +0800 Subject: [PATCH 1/8] fix: Support for dry run for logical tasks on the Master --- .../execute/AsyncMasterTaskDelayQueueLooper.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java index f797a684fbcb..640354e3a95a 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java @@ -28,6 +28,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES; + @Slf4j @Component public class AsyncMasterTaskDelayQueueLooper extends BaseDaemonThread implements AutoCloseable { @@ -86,8 +88,13 @@ public void run() { try { LogUtils.setTaskInstanceLogFullPathMDC(taskExecutionContext.getLogPath()); LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId()); - AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus = - asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); + AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus; + if (taskExecutionContext.getDryRun() == DRY_RUN_FLAG_YES) { + log.info("The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); + asyncTaskExecutionStatus = AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.SUCCESS; + } else { + asyncTaskExecutionStatus = asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); + } switch (asyncTaskExecutionStatus) { case RUNNING: // If the task status is running, means the task real status is not finished. We From 67ff48f8cf7f9906f60f9004dbca1c4447be77b0 Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Fri, 13 Sep 2024 15:34:04 +0800 Subject: [PATCH 2/8] fix:spotless --- .../runner/execute/AsyncMasterTaskDelayQueueLooper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java index 640354e3a95a..ab2a2e2e4287 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java @@ -17,6 +17,8 @@ package org.apache.dolphinscheduler.server.master.runner.execute; +import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES; + import org.apache.dolphinscheduler.common.thread.BaseDaemonThread; import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; import org.apache.dolphinscheduler.plugin.task.api.utils.LogUtils; @@ -28,8 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES; - @Slf4j @Component public class AsyncMasterTaskDelayQueueLooper extends BaseDaemonThread implements AutoCloseable { @@ -90,7 +90,8 @@ public void run() { LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId()); AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus; if (taskExecutionContext.getDryRun() == DRY_RUN_FLAG_YES) { - log.info("The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); + log.info( + "The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); asyncTaskExecutionStatus = AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.SUCCESS; } else { asyncTaskExecutionStatus = asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); From 1c9bb3041cd81ec9425a346cbac14e36b4c26d4c Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Sat, 14 Sep 2024 12:19:01 +0800 Subject: [PATCH 3/8] add ut for AsyncMasterTaskDelayQueueLooper --- .../AsyncMasterTaskDelayQueueLooperTest.java | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java new file mode 100644 index 000000000000..bcdeaf77c953 --- /dev/null +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java @@ -0,0 +1,121 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.dolphinscheduler.server.master.runner.execute; + +import static java.time.Duration.ofSeconds; +import static org.awaitility.Awaitility.await; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import org.apache.dolphinscheduler.common.constants.Constants; +import org.apache.dolphinscheduler.common.thread.ThreadUtils; +import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; + +import java.util.concurrent.ThreadPoolExecutor; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.mockito.junit.jupiter.MockitoSettings; +import org.mockito.quality.Strictness; + +@ExtendWith(MockitoExtension.class) +@MockitoSettings(strictness = Strictness.LENIENT) +public class AsyncMasterTaskDelayQueueLooperTest { + + @InjectMocks + private AsyncMasterTaskDelayQueueLooper asyncMasterTaskDelayQueueLooper; + @Mock + private AsyncMasterTaskDelayQueue asyncMasterTaskDelayQueue; + @Mock + private MasterAsyncTaskExecutorThreadPool masterAsyncTaskExecutorThreadPool; + + private final int workflowInstanceId = 1; + private final int taskInstanceId = 2; + private final String logPath = "logs"; + private static final ThreadPoolExecutor threadPoolExecutor = ThreadUtils.newDaemonFixedThreadExecutor( + "MasterAsyncTaskExecutorThreadPool", 2); + + @Test + void testTaskExecutionContextIsNotDryRun() throws Exception { + final TaskExecutionContext taskExecutionContext = new TaskExecutionContext(); + taskExecutionContext.setWorkflowInstanceId(workflowInstanceId); + taskExecutionContext.setTaskInstanceId(taskInstanceId); + taskExecutionContext.setLogPath(logPath); + taskExecutionContext.setDryRun(Constants.DRY_RUN_FLAG_NO); + MasterTaskExecutionContextHolder.putTaskExecutionContext(taskExecutionContext); + AsyncTaskExecuteFunction asyncTaskExecuteFunction = mock(AsyncTaskExecuteFunction.class); + AsyncTaskCallbackFunction asyncTaskCallbackFunction = mock(AsyncTaskCallbackFunction.class); + + final AsyncTaskExecutionContext asyncTaskExecutionContext = new AsyncTaskExecutionContext( + taskExecutionContext, + asyncTaskExecuteFunction, + asyncTaskCallbackFunction); + when(asyncTaskExecuteFunction.getAsyncTaskExecutionStatus()) + .thenReturn(AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.FAILED); + when(asyncMasterTaskDelayQueue.pollAsyncTask()).thenReturn(asyncTaskExecutionContext); + when(masterAsyncTaskExecutorThreadPool.getThreadPool()).thenReturn(threadPoolExecutor); + + asyncMasterTaskDelayQueueLooper.start(); + + await().during(ofSeconds(1)).untilAsserted(() -> { + verify(masterAsyncTaskExecutorThreadPool, atLeastOnce()).getThreadPool(); + verify(asyncTaskCallbackFunction, atLeastOnce()).executeFailed(); + }); + asyncMasterTaskDelayQueueLooper.close(); + } + + @Test + void testTaskExecutionContextIsDryRun() throws Exception { + final TaskExecutionContext taskExecutionContext = new TaskExecutionContext(); + taskExecutionContext.setWorkflowInstanceId(workflowInstanceId); + taskExecutionContext.setTaskInstanceId(taskInstanceId); + taskExecutionContext.setLogPath(logPath); + taskExecutionContext.setDryRun(Constants.DRY_RUN_FLAG_YES); + MasterTaskExecutionContextHolder.putTaskExecutionContext(taskExecutionContext); + AsyncTaskExecuteFunction asyncTaskExecuteFunction = mock(AsyncTaskExecuteFunction.class); + AsyncTaskCallbackFunction asyncTaskCallbackFunction = mock(AsyncTaskCallbackFunction.class); + + final AsyncTaskExecutionContext asyncTaskExecutionContext = new AsyncTaskExecutionContext( + taskExecutionContext, + asyncTaskExecuteFunction, + asyncTaskCallbackFunction); + when(asyncTaskExecuteFunction.getAsyncTaskExecutionStatus()) + .thenReturn(AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.RUNNING); + when(asyncMasterTaskDelayQueue.pollAsyncTask()).thenReturn(asyncTaskExecutionContext); + when(masterAsyncTaskExecutorThreadPool.getThreadPool()).thenReturn(threadPoolExecutor); + + asyncMasterTaskDelayQueueLooper.start(); + + await().during(ofSeconds(1)).untilAsserted(() -> { + verify(masterAsyncTaskExecutorThreadPool, atLeastOnce()).getThreadPool(); + verify(asyncTaskCallbackFunction, atLeastOnce()).executeSuccess(); + }); + asyncMasterTaskDelayQueueLooper.close(); + } + + @AfterAll + public static void cleanup() { + threadPoolExecutor.shutdown(); + } +} From 12742341cc373f36906af33eb4c17dcaa14518a0 Mon Sep 17 00:00:00 2001 From: yangwei <897900564@qq.com> Date: Fri, 20 Sep 2024 09:21:00 +0800 Subject: [PATCH 4/8] Fix the YAML file for the integration test. --- .../it/cases/WorkflowInstanceFailoverIT.java | 4 +-- .../workflow_with_one_fake_task_success.yaml | 4 +-- ...nstance_with_one_dispatched_fake_task.yaml | 14 ++++---- ...lowInstance_with_one_failed_fake_task.yaml | 14 ++++---- ...lowInstance_with_one_paused_fake_task.yaml | 14 ++++---- ...Instance_with_one_submitted_fake_task.yaml | 14 ++++---- ...owInstance_with_one_success_fake_task.yaml | 14 ++++---- ...nstance_with_one_dispatched_fake_task.yaml | 14 ++++---- ...lowInstance_with_one_failed_fake_task.yaml | 14 ++++---- ...lowInstance_with_one_killed_fake_task.yaml | 14 ++++---- ...Instance_with_one_submitted_fake_task.yaml | 14 ++++---- ...owInstance_with_one_success_fake_task.yaml | 14 ++++---- ...nstance_with_one_dispatched_fake_task.yaml | 14 ++++---- ...lowInstance_with_one_failed_fake_task.yaml | 14 ++++---- ...owInstance_with_one_running_fake_task.yaml | 14 ++++---- ...Instance_with_one_submitted_fake_task.yaml | 14 ++++---- ...owInstance_with_one_success_fake_task.yaml | 14 ++++---- .../workflow_with_one_fake_task_failed.yaml | 4 +-- .../workflow_with_one_fake_task_success.yaml | 4 +-- ...hree_parallel_three_fake_task_success.yaml | 36 +++++++++---------- ...re_workflow_with_two_serial_fake_task.yaml | 18 +++++----- ...ed_workflow_with_one_fake_task_failed.yaml | 14 ++++---- ...s_workflow_with_one_fake_task_success.yaml | 14 ++++---- .../success_workflow_with_task_only.yaml | 18 +++++----- .../workflow_with_one_fake_task_success.yaml | 4 +-- .../it/start/workflow_with_global_param.yaml | 8 ++--- .../workflow_with_one_fake_task_failed.yaml | 4 +-- ..._with_one_fake_task_failed_with_retry.yaml | 4 +-- .../workflow_with_one_fake_task_success.yaml | 4 +-- ...hree_parallel_three_fake_task_success.yaml | 36 +++++++++---------- ...ow_with_two_parallel_fake_task_failed.yaml | 8 ++--- ...w_with_two_parallel_fake_task_success.yaml | 8 ++--- ...flow_with_two_serial_fake_task_failed.yaml | 8 ++--- ...low_with_two_serial_fake_task_success.yaml | 8 ++--- .../workflow_with_one_fake_task_failed.yaml | 4 +-- .../workflow_with_one_fake_task_success.yaml | 4 +-- ...hree_parallel_three_fake_task_success.yaml | 36 +++++++++---------- 37 files changed, 231 insertions(+), 231 deletions(-) diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/it/cases/WorkflowInstanceFailoverIT.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/it/cases/WorkflowInstanceFailoverIT.java index cbb236996d22..21d540ceb640 100644 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/it/cases/WorkflowInstanceFailoverIT.java +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/it/cases/WorkflowInstanceFailoverIT.java @@ -289,7 +289,7 @@ public void testGlobalFailover_readyPauseWorkflow_withDispatchedTasks() { .anySatisfy(workflowInstance -> { Assertions .assertThat(workflowInstance.getState()) - .isEqualTo(WorkflowExecutionStatus.SUCCESS); + .isEqualTo(WorkflowExecutionStatus.PAUSE); Assertions .assertThat(workflowInstance.getName()) .isEqualTo("workflow_with_one_fake_task_success-20240816071251690"); @@ -469,7 +469,7 @@ public void testGlobalFailover_readyStopWorkflow_withDispatchedTasks() { .anySatisfy(workflowInstance -> { Assertions .assertThat(workflowInstance.getState()) - .isEqualTo(WorkflowExecutionStatus.SUCCESS); + .isEqualTo(WorkflowExecutionStatus.STOP); Assertions .assertThat(workflowInstance.getName()) .isEqualTo("workflow_with_one_fake_task_success-20240816071251690"); diff --git a/dolphinscheduler-master/src/test/resources/it/backfill/workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/backfill/workflow_with_one_fake_task_success.yaml index 7b6f64ff0472..6e1cab1a4eb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/backfill/workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/backfill/workflow_with_one_fake_task_success.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_dispatched_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_dispatched_fake_task.yaml index 618fa4473374..28964bcfe46f 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_dispatched_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_dispatched_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_PAUSE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_failed_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_failed_fake_task.yaml index 260042052c25..eabf2fd4402c 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_failed_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_failed_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_PAUSE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_paused_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_paused_fake_task.yaml index 51eb99b9ed17..1e2c12aefe83 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_paused_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_paused_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_PAUSE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_submitted_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_submitted_fake_task.yaml index 9cbd00d7a2c5..14abf00e960b 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_submitted_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_submitted_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_PAUSE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_success_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_success_fake_task.yaml index b7efaee10ed3..768515d75bb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_success_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyPause_workflowInstance_with_one_success_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_PAUSE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_dispatched_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_dispatched_fake_task.yaml index 4b3ca71bd4f7..cbe547459daf 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_dispatched_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_dispatched_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_STOP recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_failed_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_failed_fake_task.yaml index 11a35748633d..d6bae77e88c2 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_failed_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_failed_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_STOP recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_killed_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_killed_fake_task.yaml index eeb30b59f3a4..5478edd56ff1 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_killed_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_killed_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_STOP recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_submitted_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_submitted_fake_task.yaml index 28697650a7e6..5ad1bc531025 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_submitted_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_submitted_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_STOP recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_success_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_success_fake_task.yaml index 8d4975ec421f..25fcc75dbce6 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_success_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/readyStop_workflowInstance_with_one_success_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: READY_STOP recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -99,8 +99,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_dispatched_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_dispatched_fake_task.yaml index 609d960d5de7..90c521fa7d92 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_dispatched_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_dispatched_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: RUNNING_EXECUTION recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_failed_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_failed_fake_task.yaml index 82c14b1cf88d..4a9defc4c06b 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_failed_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_failed_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: RUNNING_EXECUTION recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -101,8 +101,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_running_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_running_fake_task.yaml index a06410be3e15..bf6d5731ada5 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_running_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_running_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: RUNNING_EXECUTION recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -100,8 +100,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_submitted_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_submitted_fake_task.yaml index da76f9d7ab35..75147db3b796 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_submitted_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_submitted_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: RUNNING_EXECUTION recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -98,8 +98,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_success_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_success_fake_task.yaml index 2fbbe531674b..60d8a1e36bb9 100644 --- a/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_success_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/failover/running_workflowInstance_with_one_success_fake_task.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: RUNNING_EXECUTION recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -101,8 +101,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_failed.yaml index 57aeedc54c57..b64863a25efb 100644 --- a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_failed.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_success.yaml index 7b6f64ff0472..6e1cab1a4eb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_one_fake_task_success.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_three_parallel_three_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_three_parallel_three_fake_task_success.yaml index 941b0121487e..8bb316acddc9 100644 --- a/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_three_parallel_three_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/pause/workflow_with_three_parallel_three_fake_task_success.yaml @@ -139,8 +139,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -148,8 +148,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 4 @@ -157,8 +157,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 4 preTaskVersion: 1 postTaskCode: 7 @@ -166,8 +166,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 @@ -175,8 +175,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 2 preTaskVersion: 1 postTaskCode: 5 @@ -184,8 +184,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 5 preTaskVersion: 1 postTaskCode: 8 @@ -193,8 +193,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 3 @@ -202,8 +202,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 3 preTaskVersion: 1 postTaskCode: 6 @@ -211,8 +211,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 6 preTaskVersion: 1 postTaskCode: 9 diff --git a/dolphinscheduler-master/src/test/resources/it/recover_failure_tasks/failure_workflow_with_two_serial_fake_task.yaml b/dolphinscheduler-master/src/test/resources/it/recover_failure_tasks/failure_workflow_with_two_serial_fake_task.yaml index b5ff2db7ae1a..72cebec447b6 100644 --- a/dolphinscheduler-master/src/test/resources/it/recover_failure_tasks/failure_workflow_with_two_serial_fake_task.yaml +++ b/dolphinscheduler-master/src/test/resources/it/recover_failure_tasks/failure_workflow_with_two_serial_fake_task.yaml @@ -26,8 +26,8 @@ project: workflowInstance: id: 1 name: workflow_with_two_serial_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: FAILURE recovery: NO @@ -39,7 +39,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -51,8 +51,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_two_parallel_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_two_parallel_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -111,8 +111,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -120,8 +120,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/repeat_running/failed_workflow_with_one_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/repeat_running/failed_workflow_with_one_fake_task_failed.yaml index 4de8c8c34235..1814e23e6b1e 100644 --- a/dolphinscheduler-master/src/test/resources/it/repeat_running/failed_workflow_with_one_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/repeat_running/failed_workflow_with_one_fake_task_failed.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: FAILURE recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -101,8 +101,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_one_fake_task_success.yaml index c39e90896ba9..21c213d7495c 100644 --- a/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_one_fake_task_success.yaml @@ -39,8 +39,8 @@ workflows: workflowInstance: id: 1 name: workflow_with_one_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: SUCCESS recovery: NO @@ -52,7 +52,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_POST commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -64,8 +64,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_one_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_one_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -101,8 +101,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_task_only.yaml b/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_task_only.yaml index 527ecf40b310..ded7dc8c0968 100644 --- a/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_task_only.yaml +++ b/dolphinscheduler-master/src/test/resources/it/repeat_running/success_workflow_with_task_only.yaml @@ -27,8 +27,8 @@ project: workflowInstance: id: 1 name: workflow_with_two_parallel_fake_task_success-20240816071251690 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 projectCode: 1 state: SUCCESS recovery: NO @@ -40,7 +40,7 @@ workflowInstance: commandParam: '{"commandType":"START_PROCESS","startNodes":[1],"commandParams":[],"timeZone":"UTC"}' taskDependType: TASK_ONLY commandStartTime: 2024-08-16 07:12:52 - isSubProcess: NO + isSubWorkflow: NO executorId: 1 historyCmd: START_PROCESS workerGroup: default @@ -52,8 +52,8 @@ taskInstances: - id: 1 name: A taskType: LogicFakeTask - processInstanceId: 1 - processInstanceName: workflow_with_two_parallel_fake_task_success-20240816071251690 + workflowInstanceId: 1 + workflowInstanceName: workflow_with_two_parallel_fake_task_success-20240816071251690 projectCode: 1 taskCode: 1 taskDefinitionVersion: 1 @@ -112,8 +112,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -121,8 +121,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/scheduling/workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/scheduling/workflow_with_one_fake_task_success.yaml index 7b6f64ff0472..6e1cab1a4eb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/scheduling/workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/scheduling/workflow_with_one_fake_task_success.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_global_param.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_global_param.yaml index 522334368cf7..9b18cc23ead9 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_global_param.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_global_param.yaml @@ -65,8 +65,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -74,8 +74,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed.yaml index 57aeedc54c57..b64863a25efb 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed_with_retry.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed_with_retry.yaml index 1564c96c2c44..f552ded0522a 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed_with_retry.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_failed_with_retry.yaml @@ -53,8 +53,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_success.yaml index 7b6f64ff0472..6e1cab1a4eb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_one_fake_task_success.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_three_parallel_three_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_three_parallel_three_fake_task_success.yaml index 941b0121487e..8bb316acddc9 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_three_parallel_three_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_three_parallel_three_fake_task_success.yaml @@ -139,8 +139,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -148,8 +148,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 4 @@ -157,8 +157,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 4 preTaskVersion: 1 postTaskCode: 7 @@ -166,8 +166,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 @@ -175,8 +175,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 2 preTaskVersion: 1 postTaskCode: 5 @@ -184,8 +184,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 5 preTaskVersion: 1 postTaskCode: 8 @@ -193,8 +193,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 3 @@ -202,8 +202,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 3 preTaskVersion: 1 postTaskCode: 6 @@ -211,8 +211,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 6 preTaskVersion: 1 postTaskCode: 9 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_failed.yaml index b0b4c7e647fa..8cf233550d95 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_failed.yaml @@ -62,8 +62,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -71,8 +71,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_success.yaml index 56f8642b75f2..ccd1b811a93e 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_parallel_fake_task_success.yaml @@ -62,8 +62,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -71,8 +71,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_failed.yaml index 7b52c3c0052b..d55669182113 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_failed.yaml @@ -62,8 +62,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -71,8 +71,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_success.yaml index d5b09e498ebb..1ff9e24173fd 100644 --- a/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/start/workflow_with_two_serial_fake_task_success.yaml @@ -61,8 +61,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -70,8 +70,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 2 diff --git a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_failed.yaml b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_failed.yaml index 57aeedc54c57..b64863a25efb 100644 --- a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_failed.yaml +++ b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_failed.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_success.yaml index 7b6f64ff0472..6e1cab1a4eb6 100644 --- a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_one_fake_task_success.yaml @@ -51,8 +51,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 diff --git a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_three_parallel_three_fake_task_success.yaml b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_three_parallel_three_fake_task_success.yaml index 941b0121487e..8bb316acddc9 100644 --- a/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_three_parallel_three_fake_task_success.yaml +++ b/dolphinscheduler-master/src/test/resources/it/stop/workflow_with_three_parallel_three_fake_task_success.yaml @@ -139,8 +139,8 @@ tasks: taskRelations: - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 1 @@ -148,8 +148,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 1 preTaskVersion: 1 postTaskCode: 4 @@ -157,8 +157,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 4 preTaskVersion: 1 postTaskCode: 7 @@ -166,8 +166,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 2 @@ -175,8 +175,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 2 preTaskVersion: 1 postTaskCode: 5 @@ -184,8 +184,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 5 preTaskVersion: 1 postTaskCode: 8 @@ -193,8 +193,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 0 preTaskVersion: 0 postTaskCode: 3 @@ -202,8 +202,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 3 preTaskVersion: 1 postTaskCode: 6 @@ -211,8 +211,8 @@ taskRelations: createTime: 2024-08-12 00:00:00 updateTime: 2024-08-12 00:00:00 - projectCode: 1 - processDefinitionCode: 1 - processDefinitionVersion: 1 + workflowDefinitionCode: 1 + workflowDefinitionVersion: 1 preTaskCode: 6 preTaskVersion: 1 postTaskCode: 9 From 80b0a433bf7f5e2a5ed063295c901a46d62fc386 Mon Sep 17 00:00:00 2001 From: yangwei <897900564@qq.com> Date: Sun, 22 Sep 2024 08:42:30 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix=EF=BC=9Aintegration=20add=20dry=20run?= =?UTF-8?q?=20case?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../master/integration/WorkflowOperator.java | 5 + .../cases/WorkflowStartTestCase.java | 103 +++++++++++++++++- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/WorkflowOperator.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/WorkflowOperator.java index 651026e3acec..3c30fe947c3a 100644 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/WorkflowOperator.java +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/WorkflowOperator.java @@ -17,6 +17,7 @@ package org.apache.dolphinscheduler.server.master.integration; +import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.dao.entity.Project; import org.apache.dolphinscheduler.dao.entity.Schedule; import org.apache.dolphinscheduler.dao.entity.WorkflowDefinition; @@ -61,6 +62,7 @@ public Integer manualTriggerWorkflow(final WorkflowTriggerDTO workflowTriggerDTO .workflowDefinitionVersion(workflowTriggerDTO.workflowDefinition.getVersion()) .startNodes(workflowTriggerDTO.getRunWorkflowCommandParam().getStartNodes()) .startParamList(workflowTriggerDTO.getRunWorkflowCommandParam().getCommandParams()) + .dryRun(workflowTriggerDTO.dryRun) .build(); final WorkflowManualTriggerResponse manualTriggerWorkflowResponse = @@ -139,6 +141,9 @@ public static class WorkflowTriggerDTO { private final WorkflowDefinition workflowDefinition; private final RunWorkflowCommandParam runWorkflowCommandParam; + + @Builder.Default + private Flag dryRun = Flag.NO; } @Data diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java index e441372086d4..e4923f579e09 100644 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java @@ -87,12 +87,50 @@ public void testStartWorkflow_with_oneSuccessTask() { Assertions .assertThat(repository.queryWorkflowInstance(workflowInstanceId)) .matches( - workflowInstance -> workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS); + workflowInstance -> workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS) + .matches( + workflowInstance -> workflowInstance.getDryRun() == Flag.NO.getCode()); + Assertions + .assertThat(repository.queryTaskInstance(workflow)) + .satisfiesExactly(taskInstance -> { + assertThat(taskInstance.getName()).isEqualTo("A"); + assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + assertThat(taskInstance.getDryRun()).isEqualTo(Flag.NO.getCode()); + }); + }); + + assertThat(workflowRepository.getAll()).isEmpty(); + } + + @Test + @DisplayName("Test start a workflow with one fake task(A) dry run success") + public void testStartWorkflow_with_oneSuccessTaskDryRun() { + final String yaml = "/it/start/workflow_with_one_fake_task_success.yaml"; + final WorkflowTestCaseContext context = workflowTestCaseContextFactory.initializeContextFromYaml(yaml); + final WorkflowDefinition workflow = context.getWorkflows().get(0); + + final WorkflowOperator.WorkflowTriggerDTO workflowTriggerDTO = WorkflowOperator.WorkflowTriggerDTO.builder() + .workflowDefinition(workflow) + .runWorkflowCommandParam(new RunWorkflowCommandParam()) + .dryRun(Flag.YES) + .build(); + final Integer workflowInstanceId = workflowOperator.manualTriggerWorkflow(workflowTriggerDTO); + + await() + .atMost(Duration.ofMinutes(1)) + .untilAsserted(() -> { + Assertions + .assertThat(repository.queryWorkflowInstance(workflowInstanceId)) + .matches( + workflowInstance -> workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS) + .matches( + workflowInstance -> workflowInstance.getDryRun() == Flag.YES.getCode()); Assertions .assertThat(repository.queryTaskInstance(workflow)) .satisfiesExactly(taskInstance -> { assertThat(taskInstance.getName()).isEqualTo("A"); assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + assertThat(taskInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); }); }); @@ -121,7 +159,65 @@ public void testStartWorkflow_with_subWorkflowTask_success() { .matches( workflowInstance -> workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS) .matches( - workflowInstance -> workflowInstance.getIsSubWorkflow() == Flag.NO); + workflowInstance -> workflowInstance.getIsSubWorkflow() == Flag.NO) + .matches( + workflowInstance -> workflowInstance.getDryRun() == Flag.NO.getCode()); + + final List subWorkflowInstance = + repository.queryWorkflowInstance(context.getWorkflows().get(1)); + Assertions + .assertThat(subWorkflowInstance) + .hasSize(1) + .satisfiesExactly(workflowInstance -> { + assertThat(workflowInstance.getState()).isEqualTo(WorkflowExecutionStatus.SUCCESS); + assertThat(workflowInstance.getIsSubWorkflow()).isEqualTo(Flag.YES); + assertThat(workflowInstance.getDryRun()).isEqualTo(Flag.NO.getCode()); + }); + + Assertions + .assertThat(repository.queryTaskInstance(workflowInstanceId)) + .satisfiesExactly(taskInstance -> { + assertThat(taskInstance.getName()).isEqualTo("sub_logic_task"); + assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + }); + + Assertions + .assertThat(repository.queryTaskInstance(subWorkflowInstance.get(0).getId())) + .satisfiesExactly(taskInstance -> { + assertThat(taskInstance.getName()).isEqualTo("fake_task"); + assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + }); + }); + + assertThat(workflowRepository.getAll()).isEmpty(); + } + + @Test + @DisplayName("Test start a workflow with one sub workflow task(A) dry run success") + public void testStartWorkflow_with_subWorkflowTask_dryRunSuccess() { + final String yaml = "/it/start/workflow_with_sub_workflow_task_success.yaml"; + final WorkflowTestCaseContext context = workflowTestCaseContextFactory.initializeContextFromYaml(yaml); + final WorkflowDefinition parentWorkflow = context.getWorkflows().get(0); + + final WorkflowOperator.WorkflowTriggerDTO workflowTriggerDTO = WorkflowOperator.WorkflowTriggerDTO.builder() + .workflowDefinition(parentWorkflow) + .runWorkflowCommandParam(new RunWorkflowCommandParam()) + .dryRun(Flag.YES) + .build(); + final Integer workflowInstanceId = workflowOperator.manualTriggerWorkflow(workflowTriggerDTO); + + await() + .atMost(Duration.ofMinutes(1)) + .untilAsserted(() -> { + + Assertions + .assertThat(repository.queryWorkflowInstance(workflowInstanceId)) + .matches( + workflowInstance -> workflowInstance.getState() == WorkflowExecutionStatus.SUCCESS) + .matches( + workflowInstance -> workflowInstance.getIsSubWorkflow() == Flag.NO) + .matches( + workflowInstance -> workflowInstance.getDryRun() == Flag.YES.getCode()); final List subWorkflowInstance = repository.queryWorkflowInstance(context.getWorkflows().get(1)); @@ -131,6 +227,7 @@ public void testStartWorkflow_with_subWorkflowTask_success() { .satisfiesExactly(workflowInstance -> { assertThat(workflowInstance.getState()).isEqualTo(WorkflowExecutionStatus.SUCCESS); assertThat(workflowInstance.getIsSubWorkflow()).isEqualTo(Flag.YES); + assertThat(workflowInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); }); Assertions @@ -138,6 +235,7 @@ public void testStartWorkflow_with_subWorkflowTask_success() { .satisfiesExactly(taskInstance -> { assertThat(taskInstance.getName()).isEqualTo("sub_logic_task"); assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + assertThat(taskInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); }); Assertions @@ -145,6 +243,7 @@ public void testStartWorkflow_with_subWorkflowTask_success() { .satisfiesExactly(taskInstance -> { assertThat(taskInstance.getName()).isEqualTo("fake_task"); assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); + assertThat(taskInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); }); }); From e0e096b38d8e63946db405e4e3af0a5ca8371d32 Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Thu, 10 Oct 2024 21:23:55 +0800 Subject: [PATCH 6/8] fix: dry run implementation in MasterTaskExecutor --- .../AsyncMasterTaskDelayQueueLooper.java | 2 +- .../runner/execute/MasterTaskExecutor.java | 10 ++++++++++ .../cases/WorkflowStartTestCase.java | 17 ++--------------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java index ab2a2e2e4287..a5e627149e94 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java @@ -91,7 +91,7 @@ public void run() { AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus; if (taskExecutionContext.getDryRun() == DRY_RUN_FLAG_YES) { log.info( - "The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); + "The current execute mode is dry run check again, will stop the logic task and set the taskInstance status to success"); asyncTaskExecutionStatus = AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.SUCCESS; } else { asyncTaskExecutionStatus = asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java index aba154fffa6b..77da5cc3c906 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java @@ -18,6 +18,7 @@ package org.apache.dolphinscheduler.server.master.runner.execute; import static ch.qos.logback.classic.ClassicConstants.FINALIZE_SESSION_MARKER; +import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES; import org.apache.dolphinscheduler.common.log.remote.RemoteLogUtils; import org.apache.dolphinscheduler.common.utils.JSONUtils; @@ -100,6 +101,15 @@ public void run() { TaskInstanceLogHeader.printInitializeTaskContextHeader(); initializeTask(); + if (DRY_RUN_FLAG_YES == taskExecutionContext.getDryRun()) { + taskExecutionContext.setCurrentExecutionStatus(TaskExecutionStatus.SUCCESS); + taskExecutionContext.setEndTime(System.currentTimeMillis()); + MasterTaskExecutorHolder.removeMasterTaskExecutor(taskExecutionContext.getTaskInstanceId()); + logicTaskInstanceExecutionEventSenderManager.successEventSender().sendMessage(taskExecutionContext); + log.info( + "The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); + return; + } TaskInstanceLogHeader.printLoadTaskInstancePluginHeader(); beforeExecute(); diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java index e4923f579e09..f91594d7d63d 100644 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java +++ b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java @@ -193,7 +193,7 @@ public void testStartWorkflow_with_subWorkflowTask_success() { } @Test - @DisplayName("Test start a workflow with one sub workflow task(A) dry run success") + @DisplayName("Test start a workflow with one sub workflow task(A) dry run, will not execute") public void testStartWorkflow_with_subWorkflowTask_dryRunSuccess() { final String yaml = "/it/start/workflow_with_sub_workflow_task_success.yaml"; final WorkflowTestCaseContext context = workflowTestCaseContextFactory.initializeContextFromYaml(yaml); @@ -223,12 +223,7 @@ public void testStartWorkflow_with_subWorkflowTask_dryRunSuccess() { repository.queryWorkflowInstance(context.getWorkflows().get(1)); Assertions .assertThat(subWorkflowInstance) - .hasSize(1) - .satisfiesExactly(workflowInstance -> { - assertThat(workflowInstance.getState()).isEqualTo(WorkflowExecutionStatus.SUCCESS); - assertThat(workflowInstance.getIsSubWorkflow()).isEqualTo(Flag.YES); - assertThat(workflowInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); - }); + .isEmpty(); Assertions .assertThat(repository.queryTaskInstance(workflowInstanceId)) @@ -237,14 +232,6 @@ public void testStartWorkflow_with_subWorkflowTask_dryRunSuccess() { assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); assertThat(taskInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); }); - - Assertions - .assertThat(repository.queryTaskInstance(subWorkflowInstance.get(0).getId())) - .satisfiesExactly(taskInstance -> { - assertThat(taskInstance.getName()).isEqualTo("fake_task"); - assertThat(taskInstance.getState()).isEqualTo(TaskExecutionStatus.SUCCESS); - assertThat(taskInstance.getDryRun()).isEqualTo(Flag.YES.getCode()); - }); }); assertThat(workflowRepository.getAll()).isEmpty(); From 0badfcc8f1b184101a1c590925862117b1990926 Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Fri, 11 Oct 2024 12:39:20 +0800 Subject: [PATCH 7/8] fix:dry run change --- .../AsyncMasterTaskDelayQueueLooper.java | 12 +- .../runner/execute/MasterTaskExecutor.java | 6 +- .../AsyncMasterTaskDelayQueueLooperTest.java | 121 ------------------ 3 files changed, 5 insertions(+), 134 deletions(-) delete mode 100644 dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java index a5e627149e94..f797a684fbcb 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooper.java @@ -17,8 +17,6 @@ package org.apache.dolphinscheduler.server.master.runner.execute; -import static org.apache.dolphinscheduler.common.constants.Constants.DRY_RUN_FLAG_YES; - import org.apache.dolphinscheduler.common.thread.BaseDaemonThread; import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; import org.apache.dolphinscheduler.plugin.task.api.utils.LogUtils; @@ -88,14 +86,8 @@ public void run() { try { LogUtils.setTaskInstanceLogFullPathMDC(taskExecutionContext.getLogPath()); LogUtils.setTaskInstanceIdMDC(taskExecutionContext.getTaskInstanceId()); - AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus; - if (taskExecutionContext.getDryRun() == DRY_RUN_FLAG_YES) { - log.info( - "The current execute mode is dry run check again, will stop the logic task and set the taskInstance status to success"); - asyncTaskExecutionStatus = AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.SUCCESS; - } else { - asyncTaskExecutionStatus = asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); - } + AsyncTaskExecuteFunction.AsyncTaskExecutionStatus asyncTaskExecutionStatus = + asyncTaskExecuteFunction.getAsyncTaskExecutionStatus(); switch (asyncTaskExecutionStatus) { case RUNNING: // If the task status is running, means the task real status is not finished. We diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java index 77da5cc3c906..52fa334386db 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java @@ -101,6 +101,9 @@ public void run() { TaskInstanceLogHeader.printInitializeTaskContextHeader(); initializeTask(); + TaskInstanceLogHeader.printLoadTaskInstancePluginHeader(); + beforeExecute(); + if (DRY_RUN_FLAG_YES == taskExecutionContext.getDryRun()) { taskExecutionContext.setCurrentExecutionStatus(TaskExecutionStatus.SUCCESS); taskExecutionContext.setEndTime(System.currentTimeMillis()); @@ -110,9 +113,6 @@ public void run() { "The current execute mode is dry run, will stop the logic task and set the taskInstance status to success"); return; } - TaskInstanceLogHeader.printLoadTaskInstancePluginHeader(); - beforeExecute(); - TaskInstanceLogHeader.printExecuteTaskHeader(); executeTask(); diff --git a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java b/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java deleted file mode 100644 index bcdeaf77c953..000000000000 --- a/dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/runner/execute/AsyncMasterTaskDelayQueueLooperTest.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.dolphinscheduler.server.master.runner.execute; - -import static java.time.Duration.ofSeconds; -import static org.awaitility.Awaitility.await; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import org.apache.dolphinscheduler.common.constants.Constants; -import org.apache.dolphinscheduler.common.thread.ThreadUtils; -import org.apache.dolphinscheduler.plugin.task.api.TaskExecutionContext; - -import java.util.concurrent.ThreadPoolExecutor; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; -import org.mockito.junit.jupiter.MockitoSettings; -import org.mockito.quality.Strictness; - -@ExtendWith(MockitoExtension.class) -@MockitoSettings(strictness = Strictness.LENIENT) -public class AsyncMasterTaskDelayQueueLooperTest { - - @InjectMocks - private AsyncMasterTaskDelayQueueLooper asyncMasterTaskDelayQueueLooper; - @Mock - private AsyncMasterTaskDelayQueue asyncMasterTaskDelayQueue; - @Mock - private MasterAsyncTaskExecutorThreadPool masterAsyncTaskExecutorThreadPool; - - private final int workflowInstanceId = 1; - private final int taskInstanceId = 2; - private final String logPath = "logs"; - private static final ThreadPoolExecutor threadPoolExecutor = ThreadUtils.newDaemonFixedThreadExecutor( - "MasterAsyncTaskExecutorThreadPool", 2); - - @Test - void testTaskExecutionContextIsNotDryRun() throws Exception { - final TaskExecutionContext taskExecutionContext = new TaskExecutionContext(); - taskExecutionContext.setWorkflowInstanceId(workflowInstanceId); - taskExecutionContext.setTaskInstanceId(taskInstanceId); - taskExecutionContext.setLogPath(logPath); - taskExecutionContext.setDryRun(Constants.DRY_RUN_FLAG_NO); - MasterTaskExecutionContextHolder.putTaskExecutionContext(taskExecutionContext); - AsyncTaskExecuteFunction asyncTaskExecuteFunction = mock(AsyncTaskExecuteFunction.class); - AsyncTaskCallbackFunction asyncTaskCallbackFunction = mock(AsyncTaskCallbackFunction.class); - - final AsyncTaskExecutionContext asyncTaskExecutionContext = new AsyncTaskExecutionContext( - taskExecutionContext, - asyncTaskExecuteFunction, - asyncTaskCallbackFunction); - when(asyncTaskExecuteFunction.getAsyncTaskExecutionStatus()) - .thenReturn(AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.FAILED); - when(asyncMasterTaskDelayQueue.pollAsyncTask()).thenReturn(asyncTaskExecutionContext); - when(masterAsyncTaskExecutorThreadPool.getThreadPool()).thenReturn(threadPoolExecutor); - - asyncMasterTaskDelayQueueLooper.start(); - - await().during(ofSeconds(1)).untilAsserted(() -> { - verify(masterAsyncTaskExecutorThreadPool, atLeastOnce()).getThreadPool(); - verify(asyncTaskCallbackFunction, atLeastOnce()).executeFailed(); - }); - asyncMasterTaskDelayQueueLooper.close(); - } - - @Test - void testTaskExecutionContextIsDryRun() throws Exception { - final TaskExecutionContext taskExecutionContext = new TaskExecutionContext(); - taskExecutionContext.setWorkflowInstanceId(workflowInstanceId); - taskExecutionContext.setTaskInstanceId(taskInstanceId); - taskExecutionContext.setLogPath(logPath); - taskExecutionContext.setDryRun(Constants.DRY_RUN_FLAG_YES); - MasterTaskExecutionContextHolder.putTaskExecutionContext(taskExecutionContext); - AsyncTaskExecuteFunction asyncTaskExecuteFunction = mock(AsyncTaskExecuteFunction.class); - AsyncTaskCallbackFunction asyncTaskCallbackFunction = mock(AsyncTaskCallbackFunction.class); - - final AsyncTaskExecutionContext asyncTaskExecutionContext = new AsyncTaskExecutionContext( - taskExecutionContext, - asyncTaskExecuteFunction, - asyncTaskCallbackFunction); - when(asyncTaskExecuteFunction.getAsyncTaskExecutionStatus()) - .thenReturn(AsyncTaskExecuteFunction.AsyncTaskExecutionStatus.RUNNING); - when(asyncMasterTaskDelayQueue.pollAsyncTask()).thenReturn(asyncTaskExecutionContext); - when(masterAsyncTaskExecutorThreadPool.getThreadPool()).thenReturn(threadPoolExecutor); - - asyncMasterTaskDelayQueueLooper.start(); - - await().during(ofSeconds(1)).untilAsserted(() -> { - verify(masterAsyncTaskExecutorThreadPool, atLeastOnce()).getThreadPool(); - verify(asyncTaskCallbackFunction, atLeastOnce()).executeSuccess(); - }); - asyncMasterTaskDelayQueueLooper.close(); - } - - @AfterAll - public static void cleanup() { - threadPoolExecutor.shutdown(); - } -} From b2debee7157e551431cf912ffa043e7537ba9826 Mon Sep 17 00:00:00 2001 From: "veli.yang" <897900564@qq.com> Date: Fri, 11 Oct 2024 21:41:28 +0800 Subject: [PATCH 8/8] fix: spotless --- .../server/master/runner/execute/MasterTaskExecutor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java index 52fa334386db..d21e81fe97df 100644 --- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java +++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/execute/MasterTaskExecutor.java @@ -103,7 +103,7 @@ public void run() { TaskInstanceLogHeader.printLoadTaskInstancePluginHeader(); beforeExecute(); - + if (DRY_RUN_FLAG_YES == taskExecutionContext.getDryRun()) { taskExecutionContext.setCurrentExecutionStatus(TaskExecutionStatus.SUCCESS); taskExecutionContext.setEndTime(System.currentTimeMillis());