tillrohrmann commented on a change in pull request #6717: [FLINK-10369][tests]
Enable YARNITCase to test per job mode deployment
URL: https://github.com/apache/flink/pull/6717#discussion_r219064427
##########
File path: flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNITCase.java
##########
@@ -79,20 +86,45 @@ public void testPerJobMode() throws Exception {
env.addSource(new InfiniteSource())
.shuffle()
- .addSink(new DiscardingSink<Integer>());
+ .addSink(new DiscardingSink<>());
final JobGraph jobGraph =
env.getStreamGraph().getJobGraph();
File testingJar = YarnTestBase.findFile("..", new
TestingYarnClusterDescriptor.TestJarFinder("flink-yarn-tests"));
jobGraph.addJar(new
org.apache.flink.core.fs.Path(testingJar.toURI()));
- ClusterClient<ApplicationId> clusterClient =
yarnClusterDescriptor.deployJobCluster(
- clusterSpecification,
- jobGraph,
- true);
+ ApplicationId applicationId = null;
+ ClusterClient<ApplicationId> clusterClient = null;
+
+ try {
+ clusterClient =
yarnClusterDescriptor.deployJobCluster(
+ clusterSpecification,
+ jobGraph,
+ false);
+ applicationId = clusterClient.getClusterId();
+
+ assertThat(clusterClient,
is(instanceOf(RestClusterClient.class)));
+ final RestClusterClient<ApplicationId>
restClusterClient = (RestClusterClient<ApplicationId>) clusterClient;
+
+ final CompletableFuture<JobStatus> jobStatus =
restClusterClient.getJobStatus(jobGraph.getJobID());
+ assertThat(jobStatus.get(),
is(JobStatus.RUNNING));
Review comment:
In this case it works because we use the standalone leader election service
which triggers as the first action the job scheduling (before we can request
the job). However, I agree that a `NoDataSource` would be better for stability
reasons. Will change it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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