zuston commented on a change in pull request #18220:
URL: https://github.com/apache/flink/pull/18220#discussion_r782251384



##########
File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNITCase.java
##########
@@ -133,6 +140,42 @@ public void testPerJobWithArchive() throws Exception {
         runTest(() -> deployPerJob(flinkConfig, archiveJobGraph, true));
     }
 
+    /**
+     * Once YARN app is accepted, it will return cluster client provider. Till 
invoking
+     * getClusterClient method, it will wait app state from accepted to 
running.
+     */
+    @Test
+    public void testPerJobOnceAppAccepted() throws Exception {
+        runTest(
+                () -> {
+                    Configuration configuration =
+                            
createDefaultConfiguration(YarnConfigOptions.UserJarInclusion.FIRST);
+                    JobGraph jobGraph = getTestingJobGraph();
+                    jobGraph.setJobType(JobType.STREAMING);
+                    try (final YarnClusterDescriptor yarnClusterDescriptor =
+                            createYarnClusterDescriptor(configuration)) {
+
+                        ClusterClientProvider<ApplicationId> 
clusterClientProvider =
+                                deployJobCluster(yarnClusterDescriptor, 
jobGraph);
+
+                        ApplicationId applicationId = 
yarnClusterDescriptor.getApplicationId();
+                        YarnClient yarnClient = getYarnClient();
+                        ApplicationReport report = 
yarnClient.getApplicationReport(applicationId);
+
+                        // Only test when app master state is accepted in 
YarnClusterDescriptor.
+                        if (ACCEPTED == report.getYarnApplicationState()) {

Review comment:
       Of course it could be in running. And if in running, it’s the same with  
previous action. So i don’t check it in this test case




-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to