[GitHub] TisonKun commented on a change in pull request #6717: [FLINK-10369][tests] Enable YARNITCase to test per job mode deployment

2018-09-20 Thread GitBox
TisonKun 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_r219171413
 
 

 ##
 File path: 
flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNHighAvailabilityITCase.java
 ##
 @@ -60,7 +60,7 @@
 /**
  * Tests that verify correct HA behavior.
  */
-public class YARNHighAvailabilityITCase extends YarnTestBase {
+   public class YARNHighAvailabilityITCase extends YarnTestBase {
 
 Review comment:
   Extra whitespace


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] TisonKun commented on a change in pull request #6717: [FLINK-10369][tests] Enable YARNITCase to test per job mode deployment

2018-09-19 Thread GitBox
TisonKun 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_r218805970
 
 

 ##
 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());
+   .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 clusterClient = 
yarnClusterDescriptor.deployJobCluster(
-   clusterSpecification,
-   jobGraph,
-   true);
+   ApplicationId applicationId = null;
+   ClusterClient clusterClient = null;
+
+   try {
+   clusterClient = 
yarnClusterDescriptor.deployJobCluster(
+   clusterSpecification,
+   jobGraph,
+   false);
+   applicationId = clusterClient.getClusterId();
+
+   assertThat(clusterClient, 
is(instanceOf(RestClusterClient.class)));
+   final RestClusterClient 
restClusterClient = (RestClusterClient) clusterClient;
+
+   final CompletableFuture jobStatus = 
restClusterClient.getJobStatus(jobGraph.getJobID());
+   assertThat(jobStatus.get(), 
is(JobStatus.RUNNING));
 
 Review comment:
   Should we wait for `RUNNING`? or say would it be unstable when we request 
jobStatus before the job switch to RUNNING?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] TisonKun commented on a change in pull request #6717: [FLINK-10369][tests] Enable YARNITCase to test per job mode deployment

2018-09-19 Thread GitBox
TisonKun 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_r218803183
 
 

 ##
 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());
+   .addSink(new DiscardingSink<>());
 
final JobGraph jobGraph = 
env.getStreamGraph().getJobGraph();
 
File testingJar = YarnTestBase.findFile("..", new 
TestingYarnClusterDescriptor.TestJarFinder("flink-yarn-tests"));
 
 Review comment:
   `TestingYarnClusterDescriptor` is inherited from 
`LegacyYarnClusterDescriptor` and should be removed. Here we rely on 
`TestingYarnClusterDescriptor.TestJarFinder`, which is a util class, and could 
move it into `YarnTestUtils` to release such dependency.


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:
us...@infra.apache.org


With regards,
Apache Git Services