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


##########
metadata/src/test/java/org/apache/kafka/metadata/PartitionRegistrationTest.java:
##########
@@ -328,23 +322,9 @@ public void 
testPartitionRegistrationToRecord_ElrShouldBeNullIfEmpty() {
         assertTrue(exceptions.isEmpty());
     }
 
-    @Property
-    public void testConsistentEqualsAndHashCode(
-        @ForAll("uniqueSamples") PartitionRegistration a,
-        @ForAll("uniqueSamples") PartitionRegistration b
-    ) {
-        if (a.equals(b)) {
-            assertEquals(a.hashCode(), b.hashCode(), "a=" + a + "\nb=" + b);
-        }
-
-        if (a.hashCode() != b.hashCode()) {
-            assertNotEquals(a, b, "a=" + a + "\nb=" + b);
-        }
-    }
-
-    @Provide
-    Arbitrary<PartitionRegistration> uniqueSamples() {
-        return Arbitraries.of(
+    @Test
+    public void testConsistentEqualsAndHashCode() {

Review Comment:
   I changed the test slightly. The original would pick 2 random samples 1000 
times. Since they are only 9 samples so 9x9=81 combinations, we can always try 
them all as it takes milliseconds to run.



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