You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2023/03/03 03:03:38 UTC

[GitHub] [flink] slfan1989 commented on a diff in pull request #22028: [FLINK-31230] Improve YarnClusterDescriptor memory unit display.

slfan1989 commented on code in PR #22028:
URL: https://github.com/apache/flink/pull/22028#discussion_r1123981772


##########
flink-yarn/src/test/java/org/apache/flink/yarn/YarnClusterDescriptorTest.java:
##########
@@ -912,4 +913,17 @@ private Map<String, String> getTestMasterEnv(
                     appId.toString());
         }
     }
+
+    @Test
+    public void testByteDesc() {
+        long bytesInMB = 1024 * 1024;
+        // 128 MB
+        assertThat(StringUtils.byteDesc(bytesInMB * 128)).isEqualTo("128 MB");
+        // 512 MB
+        assertThat(StringUtils.byteDesc(bytesInMB * 512)).isEqualTo("512 MB");
+        // 1 GB
+        assertThat(StringUtils.byteDesc(bytesInMB * 1024)).isEqualTo("1 GB");
+        // 128 GB
+        assertThat(StringUtils.byteDesc(bytesInMB * 131072)).isEqualTo("128 GB");
+    }

Review Comment:
   Thank you for your suggestion!



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org