tillrohrmann commented on a change in pull request #10608: 
[FLINK-15300][Runtime] Fix sanity check to not fail if shuffle memory fraction 
is out of min/max range
URL: https://github.com/apache/flink/pull/10608#discussion_r362813619
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/TaskExecutorResourceUtilsTest.java
 ##########
 @@ -198,6 +198,52 @@ public void testConfigShuffleMemoryRange() {
                });
        }
 
+       @Test
+       public void 
testConsistencyCheckOfDerivedShuffleMemoryWithinMinMaxRangeNotMatchingFractionPasses()
 {
+               testConsistencyCheckOfDerivedShuffleMemoryAndItsFraction(
+                       100,
+                       1000);
+       }
+
+       @Test(expected = IllegalConfigurationException.class)
+       public void 
testConsistencyCheckOfDerivedShuffleMemoryLessThanMinFails() {
+               testConsistencyCheckOfDerivedShuffleMemoryAndItsFraction(
+                       900,
+                       1000);
+       }
+
+       @Test(expected = IllegalConfigurationException.class)
+       public void 
testConsistencyCheckOfDerivedShuffleMemoryGreaterThanMaxFails() {
+               testConsistencyCheckOfDerivedShuffleMemoryAndItsFraction(
+                       100,
+                       150);
+       }
+
+       private void testConsistencyCheckOfDerivedShuffleMemoryAndItsFraction(
+                       final int shuffleMemoryMinSizeMb,
+                       final int shuffleMemoryMaxSizeMb) {
+               final Configuration conf = new Configuration();
+               conf.setString(TaskManagerOptions.SHUFFLE_MEMORY_MIN, 
shuffleMemoryMinSizeMb + "m");
+               conf.setString(TaskManagerOptions.SHUFFLE_MEMORY_MAX, 
shuffleMemoryMaxSizeMb + "m");
+               conf.setFloat(TaskManagerOptions.SHUFFLE_MEMORY_FRACTION, 0.2f);
+
+               // we have to configure total flink, task heap and managed 
memory then the rest of total flink memory is
+               // used for shuffle memory which should be consistent with its 
fraction
+               // rest is left for shuffle memory
+               validateInConfigWithExplicitTotalFlinkAndTaskHeapMem(conf, stub 
-> {});
+       }
+
+       @Test(expected = IllegalConfigurationException.class)
+       public void 
testConsistencyCheckOfDerivedShuffleMemoryDoesNotMatchLegacyConfigFails() {
+               final Configuration conf = new Configuration();
+               
conf.setInteger(NettyShuffleEnvironmentOptions.NETWORK_NUM_BUFFERS, 10);
+
+               // we have to configure total flink, task heap and managed 
memory then the rest of total flink memory is
+               // used for shuffle memory which should be consistent with its 
fraction
+               // rest is left for shuffle memory
+               validateInConfigWithExplicitTotalFlinkAndTaskHeapMem(conf, stub 
-> {});
 
 Review comment:
   It is not very clear to me why this test fails. Again I assume that it 
somehow relies on the values inserted by 
`validateInConfigWithExplicitTotalFlinkAndTaskHeapMem` or one of the child 
methods.

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