GJL commented on a change in pull request #10256: [FLINK-14467][runtime] Let 
MesosJobClusterEntrypoint use user code class loader
URL: https://github.com/apache/flink/pull/10256#discussion_r352078105
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/overlays/FlinkDistributionOverlayTest.java
 ##########
 @@ -114,6 +118,30 @@ public void testBuilderFromEnvironment() throws Exception 
{
                assertEquals(confFolder.getAbsolutePath(), 
builder.flinkConfPath.getAbsolutePath());
        }
 
+       @Test
+       public void testSettingFlinkHomeEnv() throws IOException {
+               final ContainerSpecification containerSpecification = new 
ContainerSpecification();
+               final Configuration conf = new Configuration();
+               final File binFolder = tempFolder.newFolder("bin");
+               final File libFolder = tempFolder.newFolder("lib");
+               final File confFolder = tempFolder.newFolder("conf");
+
+               // adjust the test environment for the purposes of this test
+               final Map<String, String> map = new HashMap<String, 
String>(System.getenv());
+               map.put(ENV_FLINK_BIN_DIR, binFolder.getAbsolutePath());
+               map.put(ENV_FLINK_LIB_DIR, libFolder.getAbsolutePath());
+               map.put(ENV_FLINK_CONF_DIR, confFolder.getAbsolutePath());
+
+               CommonTestUtils.setEnv(map);
 
 Review comment:
   Here is how `HadoopConfigLoadingTest` does it:
   ```
   final Map<String, String> originalEnv = System.getenv();
                final Map<String, String> newEnv = new HashMap<>(originalEnv);
                newEnv.put("HADOOP_CONF_DIR", hadoopConfDir.getAbsolutePath());
                newEnv.put("HADOOP_HOME", hadoopHome.getAbsolutePath());
                try {
                        CommonTestUtils.setEnv(newEnv);
                        hadoopConf = HadoopUtils.getHadoopConfiguration(new 
Configuration());
                }
                finally {
                        CommonTestUtils.setEnv(originalEnv);
                }
   ```
   
   

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