suez1224 commented on a change in pull request #6828: [FLINK-10516] [yarn] fix
YarnApplicationMasterRunner fail to initialize FileSystem with correct Flink
Configuration during setup
URL: https://github.com/apache/flink/pull/6828#discussion_r224638155
##########
File path:
flink-yarn/src/test/java/org/apache/flink/yarn/YarnApplicationMasterRunnerTest.java
##########
@@ -109,4 +120,37 @@ public Object answer(InvocationOnMock invocationOnMock)
throws Throwable {
taskManagerConf, workingDirectory,
taskManagerMainClass, LOG);
assertEquals("file",
ctx.getLocalResources().get("flink.jar").getResource().getScheme());
}
+
+ @Test
+ public void testRunAndInitializeFileSystem() throws Exception {
+ // Mock necessary system variables
+ Map<String, String> map = new HashMap<String,
String>(System.getenv());
+ map.put(YarnConfigKeys.ENV_HADOOP_USER_NAME, "foo");
+ // Create dynamic properties to be used in the Flink
configuration
+ map.put(YarnConfigKeys.ENV_DYNAMIC_PROPERTIES, "myKey=myValue");
+ CommonTestUtils.setEnv(map);
+
+ // Create a temporary flink-conf.yaml and to be deleted on JVM
exits
+ File currDir = new
File(System.getenv().get(ApplicationConstants.Environment.PWD.key()));
Review comment:
There is already a flink-conf.yaml in the test resource directory. You can
reuse it.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services