SbloodyS commented on code in PR #18069:
URL: 
https://github.com/apache/dolphinscheduler/pull/18069#discussion_r3057906500


##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api/test/cases/tasks/EmrServerlessTaskAPITest.java:
##########
@@ -136,6 +140,25 @@ public void testEmrServerlessSuccessWorkflowInstance() {
             
Assertions.assertTrue(startWorkflowInstanceResponse.getBody().getSuccess());
 
             workflowInstanceIds = (List<Integer>) 
startWorkflowInstanceResponse.getBody().getData();
+            Assertions.assertFalse(workflowInstanceIds.isEmpty(), "No workflow 
instances were created");
+
+            // Wait for workflow instance to finish and assert SUCCESS
+            int workflowInstanceId = workflowInstanceIds.get(0);
+            log.info("Waiting for EMR Serverless success workflow instance: 
{}", workflowInstanceId);
+            while (true) {

Review Comment:
   Avoid using an infinite loop in the test, and it is best to increase the 
timeout time to 60 seconds or 120 seconds.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api/test/cases/tasks/EmrServerlessTaskAPITest.java:
##########
@@ -136,6 +140,25 @@ public void testEmrServerlessSuccessWorkflowInstance() {
             
Assertions.assertTrue(startWorkflowInstanceResponse.getBody().getSuccess());
 
             workflowInstanceIds = (List<Integer>) 
startWorkflowInstanceResponse.getBody().getData();
+            Assertions.assertFalse(workflowInstanceIds.isEmpty(), "No workflow 
instances were created");
+
+            // Wait for workflow instance to finish and assert SUCCESS
+            int workflowInstanceId = workflowInstanceIds.get(0);
+            log.info("Waiting for EMR Serverless success workflow instance: 
{}", workflowInstanceId);
+            while (true) {
+                Thread.sleep(5000);

Review Comment:
   It is best to use a waiting time of 1 second or 2 seconds.



##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api/test/cases/tasks/EmrServerlessTaskAPITest.java:
##########
@@ -177,6 +200,27 @@ public void testEmrServerlessFailedWorkflowInstance() {
                     failedWorkflowDefinitionCode, scheduleTime, 
FailureStrategy.END, WarningType.NONE);
             
Assertions.assertTrue(startWorkflowInstanceResponse.getBody().getSuccess());
 
+            List<Integer> failedWorkflowInstanceIds =
+                    (List<Integer>) 
startWorkflowInstanceResponse.getBody().getData();
+            Assertions.assertFalse(failedWorkflowInstanceIds.isEmpty(), "No 
workflow instances were created");
+
+            // Wait for workflow instance to finish and assert FAILURE
+            int failedWorkflowInstanceId = failedWorkflowInstanceIds.get(0);
+            log.info("Waiting for EMR Serverless failed workflow instance: 
{}", failedWorkflowInstanceId);
+            while (true) {
+                Thread.sleep(5000);

Review Comment:
   Same here.



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