ruanwenjun commented on code in PR #16616:
URL: 
https://github.com/apache/dolphinscheduler/pull/16616#discussion_r1795220443


##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java:
##########
@@ -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<WorkflowInstance> 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() {

Review Comment:
   This might make confusion, since other task dry run will not go into the 
task plugin logic. It's better to keep this consistent.
   
   You should do this change in `MasterTaskExecutor`, otherwise the other logic 
task still doesn't support dry run.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to