mimaison commented on code in PR #20359:
URL: https://github.com/apache/kafka/pull/20359#discussion_r2444521318


##########
clients/src/test/java/org/apache/kafka/common/utils/UtilsTest.java:
##########
@@ -117,6 +118,35 @@ public void testMurmur2() {
         }
     }
 
+    private static String toHexString(byte[] buf) {
+        StringBuilder bld = new StringBuilder();
+        for (byte b : buf) {
+            bld.append(String.format("%02x", b));
+        }
+        return bld.toString();
+    }
+
+    @Test
+    public void testMurmur2Checksum() {
+        // calculates the checksum of hashes of many different random byte 
arrays of variable length
+        // this test detects any incompatible changes to the Murmur2 
implementation with near certainty
+        int numTrials = 100;
+        int maxLen = 1000;
+        SplittableRandom random = new SplittableRandom(0xbd4458b165652255L);

Review Comment:
   I wonder if a plain dumb seed, for example "0123456789" would be better. I 
got to admit I was wondering where `0xbd4458b165652255L` came from.
   
   @chia7712 @showuon What do you think?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to