tillrohrmann commented on a change in pull request #8539: [FLINK-12617] 
[container] StandaloneJobClusterEntrypoint defaults to random JobID for non-HA 
setups
URL: https://github.com/apache/flink/pull/8539#discussion_r288198265
 
 

 ##########
 File path: 
flink-container/src/test/java/org/apache/flink/container/entrypoint/StandaloneJobClusterConfigurationParserFactoryTest.java
 ##########
 @@ -73,17 +96,37 @@ public void testEntrypointClusterConfigurationParsing() 
throws FlinkParseExcepti
 
                assertThat(clusterConfiguration.getSavepointRestoreSettings(), 
is(equalTo(SavepointRestoreSettings.none())));
 
-               assertThat(clusterConfiguration.getJobId(), 
is(equalTo(DEFAULT_JOB_ID)));
+               assertThat(clusterConfiguration.getJobId(), is(equalTo(jobId)));
+       }
+
+       @Test
+       public void testJobIDDefaultsToRandomJobIdWithoutHA() throws 
FlinkParseException {
+               final String[] args = {"--configDir", confDirPath};
+
+               final StandaloneJobClusterConfiguration clusterConfiguration = 
commandLineParser.parse(args);
+
+               assertThat(clusterConfiguration.getJobId(), 
is(not(nullValue())));
+               assertThat(clusterConfiguration.getJobId(), 
is(not(equalTo(ZERO_JOB_ID))));
+       }
+
+       @Test
+       public void testJobIDDefaultsToZeroJobIdWithHA() throws 
FlinkParseException, FileNotFoundException {
+               final String[] args = {"--configDir", confDirPath};
+
+               final StandaloneJobClusterConfiguration clusterConfiguration = 
commandLineParser.parse(args);
+
+               configureHighAvailabilityGlobally();
+
+               assertThat(clusterConfiguration.getJobId(), 
is(not(equalTo(ZERO_JOB_ID))));
 
 Review comment:
   the `not` should not be here

----------------------------------------------------------------
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