NicoK commented on a change in pull request #10113: [FLINK-13749][client] Make 
PackagedProgram respect classloading policy
URL: https://github.com/apache/flink/pull/10113#discussion_r344181747
 
 

 ##########
 File path: 
flink-tests/src/test/java/org/apache/flink/test/classloading/ClassLoaderITCase.java
 ##########
 @@ -376,4 +390,72 @@ public void testDisposeSavepointWithCustomKvState() 
throws Exception {
                invokeThread.join(deadline.timeLeft().toMillis());
                assertFalse("Program invoke thread still running", 
invokeThread.isAlive());
        }
+
+       @Test
+       public void testProgramWithChildFirstClassLoader() throws IOException, 
ProgramInvocationException {
+               // We have two files named test-resource in src/resource 
(parent classloader classpath) and
+               // tmp folders (child classloader classpath) respectively.
+               String childResourceDirName = "child0";
+               String testResourceName = "test-resource";
+               File childResourceDir = FOLDER.newFolder(childResourceDirName);
+               File childResource = new 
File(childResourceDir.getAbsolutePath() + File.separator + testResourceName);
+               Files.touch(childResource);
+
+               TestStreamEnvironment.setAsContext(
+                       miniClusterResource.getMiniCluster(),
+                       parallelism,
+                       Collections.singleton(new 
Path(CLASSLOADING_POLICY_JAR_PATH)),
+                       Collections.emptyList());
+
+               // default child first classloading
+               final PackagedProgram childFirstProgram = new PackagedProgram(
+                               new File(CLASSLOADING_POLICY_JAR_PATH),
+                               
Lists.newArrayList(childResourceDir.toURI().toURL()),
+                               new Configuration(),
+                               new String[]{testResourceName, 
childResourceDirName}
 
 Review comment:
   ```suggestion
                                testResourceName, childResourceDirName
   ```

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