ableegoldman commented on code in PR #12971:
URL: https://github.com/apache/kafka/pull/12971#discussion_r1044153926


##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyInnerJoinCustomPartitionerIntegrationTest.java:
##########
@@ -196,19 +202,16 @@ public void 
shouldThrowIllegalArgumentExceptionWhenCustomPartionerReturnsMultipl
 
         for (final KafkaStreams stream: kafkaStreamsList) {
             stream.setUncaughtExceptionHandler(e -> {
-                assertEquals("The partitions returned by 
StreamPartitioner#partitions method when used for FK join should be a singleton 
set", e.getCause().getMessage());
+                Assertions.assertEquals("The partitions returned by 
StreamPartitioner#partitions method when used for FK join should be a singleton 
set", e.getCause().getMessage());
                 return 
StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.SHUTDOWN_CLIENT;
             });
         }
 
         startApplicationAndWaitUntilRunning(kafkaStreamsList, ofSeconds(120));
 
-        // Sleeping to let the processing happen inducing the failure
-        Thread.sleep(60000);
+        // the streams applications should in failed state due to the 
IllegalStateException.
+        waitForApplicationState(Arrays.asList(streams, streamsTwo, 
streamsThree), KafkaStreams.State.ERROR, ofSeconds(30));

Review Comment:
   nit: no idea if we actually used the full 60s that we used to sleep, but 
let's continue to give it 60s



##########
streams/src/test/java/org/apache/kafka/streams/integration/KTableKTableForeignKeyInnerJoinCustomPartitionerIntegrationTest.java:
##########
@@ -196,19 +202,16 @@ public void 
shouldThrowIllegalArgumentExceptionWhenCustomPartionerReturnsMultipl
 
         for (final KafkaStreams stream: kafkaStreamsList) {
             stream.setUncaughtExceptionHandler(e -> {
-                assertEquals("The partitions returned by 
StreamPartitioner#partitions method when used for FK join should be a singleton 
set", e.getCause().getMessage());
+                Assertions.assertEquals("The partitions returned by 
StreamPartitioner#partitions method when used for FK join should be a singleton 
set", e.getCause().getMessage());
                 return 
StreamsUncaughtExceptionHandler.StreamThreadExceptionResponse.SHUTDOWN_CLIENT;
             });
         }
 
         startApplicationAndWaitUntilRunning(kafkaStreamsList, ofSeconds(120));
 
-        // Sleeping to let the processing happen inducing the failure
-        Thread.sleep(60000);
+        // the streams applications should in failed state due to the 
IllegalStateException.

Review Comment:
   ```suggestion
           // the streams applications should have shut down into `ERROR` due 
to the IllegalStateException
   ```



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