azagrebin commented on a change in pull request #10146: [FLINK-14188][runtime] 
TaskExecutor derive and register with default slot resource profile
URL: https://github.com/apache/flink/pull/10146#discussion_r348383702
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/TaskExecutorResourceUtilsTest.java
 ##########
 @@ -85,6 +88,25 @@ public void testGenerateJvmParameters() {
                
assertThat(MemorySize.parse(configs.get("-XX:MaxMetaspaceSize=")), 
is(TM_RESOURCE_SPEC.getJvmMetaspaceSize()));
        }
 
+       @Test
+       public void testConfigCpuCores() {
+               final double cpuCores = 1.0;
+
+               Configuration conf = new Configuration();
+               conf.setDouble(TaskManagerOptions.CPU_CORES_KEY, cpuCores);
+
+               validateInAllConfigurations(conf, taskExecutorResourceSpec -> 
assertThat(taskExecutorResourceSpec.getCpuCores(), is(Optional.of(cpuCores))));
+       }
+
+       @Test
+       public void testConfigNoCpuCores() {
+               Configuration conf = new Configuration();
+               validateInAllConfigurations(conf, taskExecutorResourceSpec -> 
assertThat(taskExecutorResourceSpec.getCpuCores(), is(Optional.empty())));
+
+               conf.setDouble(TaskManagerOptions.CPU_CORES_KEY, -0.1f);
 
 Review comment:
   better to split into a separate test: `testConfigNegativeCpuCores`

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