xintongsong commented on a change in pull request #10161:
[FLINK-13986][runtime] Clean up legacy code for FLIP-49.
URL: https://github.com/apache/flink/pull/10161#discussion_r347868603
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/ContaineredTaskManagerParametersTest.java
##########
@@ -98,40 +56,15 @@ public void
testTotalMemoryDoesNotExceedContainerMemoryOffHeap() {
conf.setBoolean(MEMORY_OFF_HEAP, true);
ContaineredTaskManagerParameters params =
- ContaineredTaskManagerParameters.create(conf,
CONTAINER_MEMORY, 1);
-
- assertTrue(params.taskManagerDirectMemoryLimitMB() > 0L);
+ ContaineredTaskManagerParameters.create(conf,
getTmResourceSpec(), 1);
assertTrue(params.taskManagerHeapSizeMB() +
- params.taskManagerDirectMemoryLimitMB() <=
CONTAINER_MEMORY);
+ params.taskManagerDirectMemoryLimitMB() <=
CONTAINER_MEMORY_MB);
}
- /**
- * Test to guard {@link
ContaineredTaskManagerParameters#calculateCutoffMB(Configuration, long)}.
- */
- @Test
- public void testCalculateCutoffMB() {
-
- Configuration config = new Configuration();
- long containerMemoryMB = 1000L;
-
-
config.setFloat(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO, 0.1f);
-
config.setInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN, 128);
-
- assertEquals(128,
-
ContaineredTaskManagerParameters.calculateCutoffMB(config, containerMemoryMB));
-
-
config.setFloat(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO, 0.2f);
- assertEquals(200,
-
ContaineredTaskManagerParameters.calculateCutoffMB(config, containerMemoryMB));
-
-
config.setInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN, 1000);
-
- try {
-
ContaineredTaskManagerParameters.calculateCutoffMB(config, containerMemoryMB);
- fail("Expected to fail with an invalid argument
exception.");
- } catch (IllegalArgumentException ignored) {
- // we expected it.
- }
+ private static TaskExecutorResourceSpec getTmResourceSpec() {
Review comment:
I'm in favor of removing these test cases. We already have sanity checks in
`TaskExecutorResourceUtils` and test cases in `TaskExecutorResourceUtilsTests`
to make sure total process memory is not exceeded.
WDYT?
----------------------------------------------------------------
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