You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lucasbru (via GitHub)" <gi...@apache.org> on 2025/06/23 13:42:12 UTC

[PR] KAFKA-19429: Deflake streams_smoke_test [kafka]

lucasbru opened a new pull request, #20019:
URL: https://github.com/apache/kafka/pull/20019

   It looks like we are checking for properties that are not guaranteed under at_least_once, for example, exact counting (not allowing for overcounting).
   
   This change relaxes the validation constraint to only check that we counted _at least_ N messages, and our sums come out as _at least_ the expected sum.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-19429: Deflake streams_smoke_test [kafka]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #20019:
URL: https://github.com/apache/kafka/pull/20019#discussion_r2161676037


##########
streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java:
##########
@@ -591,6 +599,18 @@ private static boolean verify(final PrintStream resultStream,
         }
     }
 
+    private static Boolean lessEquals(final Number expected, final Number actual) {

Review Comment:
   Change the return type of `lessEquals` from `Boolean` to primitive `boolean` to avoid unnecessary boxing/unboxing.
   ```suggestion
       private static boolean lessEquals(final Number expected, final Number actual) {
   ```



##########
streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java:
##########
@@ -591,6 +599,18 @@ private static boolean verify(final PrintStream resultStream,
         }
     }
 
+    private static Boolean lessEquals(final Number expected, final Number actual) {
+        if (actual instanceof Integer && expected instanceof Integer) {
+            return actual.intValue() >= expected.intValue();
+        } else if (actual instanceof Long && expected instanceof Long) {
+            return actual.longValue() >= expected.longValue();
+        } else if (actual instanceof Double && expected instanceof Double) {
+            return actual.doubleValue() >= expected.doubleValue();
+        } else {
+            throw new RuntimeException("Unexpected type: " + actual.getClass());
+        }

Review Comment:
   The current implementation of `lessEquals` only handles cases where both `expected` and `actual` are of the same numeric type; mixed-type comparisons (e.g., `Integer` vs `Long`) will fall through and throw. Consider normalizing to a common type (e.g., `doubleValue()`) or supporting more combinations.
   ```suggestion
           if (expected == null || actual == null) {
               throw new IllegalArgumentException("Expected and actual values must not be null");
           }
           return actual.doubleValue() >= expected.doubleValue();
   ```



##########
streams/src/test/java/org/apache/kafka/streams/tests/SmokeTestDriver.java:
##########
@@ -591,6 +599,18 @@ private static boolean verify(final PrintStream resultStream,
         }
     }
 
+    private static Boolean lessEquals(final Number expected, final Number actual) {
+        if (actual instanceof Integer && expected instanceof Integer) {
+            return actual.intValue() >= expected.intValue();
+        } else if (actual instanceof Long && expected instanceof Long) {
+            return actual.longValue() >= expected.longValue();
+        } else if (actual instanceof Double && expected instanceof Double) {
+            return actual.doubleValue() >= expected.doubleValue();
+        } else {
+            throw new RuntimeException("Unexpected type: " + actual.getClass());

Review Comment:
   Use a more specific exception type such as `IllegalArgumentException` for unexpected input rather than a generic `RuntimeException`.
   ```suggestion
               throw new IllegalArgumentException("Unexpected type: " + actual.getClass());
   ```



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-19429: Deflake streams_smoke_test [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on PR #20019:
URL: https://github.com/apache/kafka/pull/20019#issuecomment-2996555682

   PTAL @aliehsaeedii 


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-19429: Deflake streams_smoke_test [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on PR #20019:
URL: https://github.com/apache/kafka/pull/20019#issuecomment-2997436057

   Test run results https://confluent-open-source-kafka-branch-builder-system-test-results.s3-us-west-2.amazonaws.com/trunk/2025-06-23--001.02295be1-b01d-4ad9-b36d-6b9d0a06bbf5--1750694196--lucasbru--deflake_streams_smoke_test--c9717bf50d/report.html


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-19429: Deflake streams_smoke_test [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru merged PR #20019:
URL: https://github.com/apache/kafka/pull/20019


-- 
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: jira-unsubscribe@kafka.apache.org

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