tillrohrmann commented on a change in pull request #11039: [FLINK-15942] Do not log huge/infinite cpu/memory resources in profiles URL: https://github.com/apache/flink/pull/11039#discussion_r376501880
########## File path: flink-runtime/src/test/java/org/apache/flink/runtime/clusterframework/types/ResourceProfileTest.java ########## @@ -387,4 +392,36 @@ public void testSingletonPropertyOfAny() throws Exception { assertSame(ResourceProfile.ANY, copiedProfile); } + + @Test + public void testToStringWithoutCpu() { + double notLoggedCpu = MAX_CPU_CORE_NUMBER_TO_LOG.doubleValue() + 1.0; + ResourceProfile resourceProfile = getResourceProfileForLogsWithCpuVal(notLoggedCpu); + assertThat(resourceProfile.toString(), is(getExpectedToString(resourceProfile, ""))); + } + + @Test + public void testToStringWithCpu() { + ResourceProfile resourceProfile = getResourceProfileForLogsWithCpuVal(1.0); + assertThat(resourceProfile.toString(), is(getExpectedToString(resourceProfile, "cpuCores=1.0, "))); Review comment: I think we could simplify the assertion a bit by testing whether the string contains `cpuCores` and a configured memory. ---------------------------------------------------------------- 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