tillrohrmann commented on a change in pull request #9105: [FLINK-13241][Yarn/Mesos] Fix Yarn/MesosResourceManager setting managed memory size into wrong configuration instance. URL: https://github.com/apache/flink/pull/9105#discussion_r306380629
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/ResourceManagerTest.java ########## @@ -270,4 +282,49 @@ private TestingResourceManager createAndStartResourceManager(HeartbeatServices h return resourceManager; } + + /** + * Tests that RM and TM calculate same slot resource profile. + */ + @Test + public void testCreateSlotsPerWorker() throws Exception { + testCreateSlotsPerWorker(new Configuration()); + + Configuration config1 = new Configuration(); + config1.setInteger(TaskManagerOptions.NUM_TASK_SLOTS, 5); + testCreateSlotsPerWorker(config1); + + Configuration config2 = new Configuration(); + config2.setString(TaskManagerOptions.MANAGED_MEMORY_SIZE, "789m"); + testCreateSlotsPerWorker(config2); + + Configuration config3 = new Configuration(); + config3.setString(TaskManagerOptions.MANAGED_MEMORY_SIZE, "300m"); + config3.setBoolean(TaskManagerOptions.MEMORY_OFF_HEAP, true); + testCreateSlotsPerWorker(config3); + + Configuration config4 = new Configuration(); + config4.setString(NettyShuffleEnvironmentOptions.NETWORK_BUFFERS_MEMORY_MAX, "10m"); + config4.setString(NettyShuffleEnvironmentOptions.NETWORK_BUFFERS_MEMORY_MIN, "10m"); + config4.setBoolean(TaskManagerOptions.MEMORY_OFF_HEAP, true); + testCreateSlotsPerWorker(config4); + } + + private void testCreateSlotsPerWorker(Configuration config) throws Exception { + resourceManager = createAndStartResourceManager(heartbeatServices, config); Review comment: I feels a bit weird that we are instantiating the `ResourceManager` in order to test a static helper method. I think this is an indicator that something is wrong with the chosen abstractions. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services