shuai-xu commented on a change in pull request #9175: [FLINK-12038] [test] fix 
YARNITCase random fail
URL: https://github.com/apache/flink/pull/9175#discussion_r306731381
 
 

 ##########
 File path: 
flink-yarn-tests/src/test/java/org/apache/flink/yarn/YarnTestBase.java
 ##########
 @@ -573,6 +574,20 @@ public static int getRunningContainers() {
                return count;
        }
 
+       public void waitUntilApplicationFinished(ApplicationId applicationId, 
int timeout) throws Exception {
+               Deadline deadline = 
Deadline.now().plus(Duration.ofSeconds(timeout));
+               while (deadline.hasTimeLeft()) {
+                       YarnApplicationState state = 
yarnClient.getApplicationReport(applicationId).getYarnApplicationState();
+                       if (state == YarnApplicationState.FINISHED ||
+                                       state == YarnApplicationState.FAILED ||
+                                       state == YarnApplicationState.KILLED) {
+                               break;
+                       } else {
+                               sleep(500);
 
 Review comment:
   OK

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to