zuston commented on a change in pull request #18220: URL: https://github.com/apache/flink/pull/18220#discussion_r777838682
########## File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNITCase.java ########## @@ -133,6 +140,38 @@ public void testPerJobWithArchive() throws Exception { runTest(() -> deployPerJob(flinkConfig, archiveJobGraph, true)); } + @Test + public void testPerJobModeWithAsyncClusterClientProvider() 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); + + assertEquals(ACCEPTED, report.getYarnApplicationState()); + + ClusterClient<ApplicationId> clusterClient = + clusterClientProvider.getClusterClient(); + + report = yarnClient.getApplicationReport(applicationId); + assertEquals(RUNNING, report.getYarnApplicationState()); + + checkApplicationFinished( + clusterClient, yarnClusterDescriptor, jobGraph, configuration); + } + }); Review comment: Just verify that once application is accepted, the cluster client provider will be returned. And it will block waiting app state from accepted to running utill invoking `getClusterClient` method. -- 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