walterddr commented on a change in pull request #9336: 
[FLINK-13548][Deployment/YARN]Support priority of the Flink YARN application
URL: https://github.com/apache/flink/pull/9336#discussion_r318305310
 
 

 ##########
 File path: 
flink-yarn/src/test/java/org/apache/flink/yarn/FlinkYarnSessionCliTest.java
 ##########
 @@ -137,6 +137,32 @@ public void testCorrectSettingOfDetachedMode() throws 
Exception {
                assertTrue(descriptor.isDetachedMode());
        }
 
+       @Test
+       public void testConfigurationBeforeDeployment() throws Exception {
+               String[] params = new String[] { "-yD", 
"yarn.application.priority=10"};
+
+               FlinkYarnSessionCli yarnCLI = new FlinkYarnSessionCli(
+                       new Configuration(),
+                       tmp.getRoot().getAbsolutePath(),
+                       "y",
+                       "yarn");
+
+               CommandLine commandLine = 
yarnCLI.parseCommandLineOptions(params, true);
+
+               AbstractYarnClusterDescriptor descriptor = 
yarnCLI.createClusterDescriptor(commandLine);
+               Configuration flinkConfiguration = 
descriptor.getFlinkConfiguration();
+
+               // YarnClusterDescriptor will add dynamic properties to local 
flinkConfiguraton before deployment
+               Map<String, String> dynProperties =
+                       
FlinkYarnSessionCli.getDynamicProperties(descriptor.getDynamicPropertiesEncoded());
+               for (Map.Entry<String, String> dynProperty : 
dynProperties.entrySet()) {
+                       flinkConfiguration.setString(dynProperty.getKey(), 
dynProperty.getValue());
+               }
+
+               int priority = 
flinkConfiguration.getInteger(YarnConfigOptions.APPLICATION_PRIORITY);
+               assertEquals(10, priority);
+       }
 
 Review comment:
   +1. Sorry for missing this point. I think yes, it is better to test it this 
way. One I can think of is:
   create a cluster descriptor similar to this:
   
https://github.com/apache/flink/blob/17e2747e575cc4d9847be76b5ce9a75a7b6707f7/flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java#L541
   but instead, pass in a mock version of YarnClient. Then verify that the 
following submission to the yarnClient actually contains an appContext that has 
priority set correctly. 
   
https://github.com/apache/flink/blob/17e2747e575cc4d9847be76b5ce9a75a7b6707f7/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L1003
   
   is this what you had in mind, @tillrohrmann ?

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