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


##########
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:
   Why the parent workflow using dry run but still generate sub workflow 
instance? If use dry run then the SubWorkflow task will not generate sub 
workflow instance.



-- 
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