tillrohrmann commented on a change in pull request #10076: 
[FLINK-14465][runtime] Let `StandaloneJobClusterEntrypoint` use user code class 
loader
URL: https://github.com/apache/flink/pull/10076#discussion_r342067755
 
 

 ##########
 File path: 
flink-container/src/test/java/org/apache/flink/container/entrypoint/ClassPathJobGraphRetrieverTest.java
 ##########
 @@ -160,6 +238,80 @@ public void testJarFromClassPathSupplier() throws 
IOException {
                assertThat(jarFiles, contains(file1, file2));
        }
 
+       @Test
+       public void testJobGraphRetrievalFailIfJobDirDoesNotHaveEntryClass() 
throws IOException {
+               final File testJar = TestJob.getTestJobJar();
+               final ClassPathJobGraphRetriever classPathJobGraphRetriever = 
new ClassPathJobGraphRetriever(
+                       new JobID(),
+                       SavepointRestoreSettings.none(),
+                       PROGRAM_ARGUMENTS,
+                       null,
+                       // only find the entry class from job dir
+                       () -> Collections.singleton(testJar),
+                       userDirHasNotEntryClass);
+               try {
+                       classPathJobGraphRetriever.retrieveJobGraph(new 
Configuration());
+               } catch (FlinkException e) {
+                       StringWriter errors = new StringWriter();
+                       e.printStackTrace(new PrintWriter(errors));
+                       assertTrue(errors.toString().contains("Failed to find 
job JAR on class path"));
 
 Review comment:
   I'd suggest to use `ExceptionUtils#findThrowableWithMessage`

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