yashmayya commented on code in PR #13375:
URL: https://github.com/apache/kafka/pull/13375#discussion_r1147214226


##########
connect/runtime/src/test/java/org/apache/kafka/connect/integration/ConnectWorkerIntegrationTest.java:
##########
@@ -195,7 +197,22 @@ public void testRestartFailedTask() throws Exception {
     public void testBrokerCoordinator() throws Exception {
         ConnectorHandle connectorHandle = 
RuntimeHandles.get().connectorHandle(CONNECTOR_NAME);
         
workerProps.put(DistributedConfig.SCHEDULED_REBALANCE_MAX_DELAY_MS_CONFIG, 
String.valueOf(5000));
-        connect = connectBuilder.workerProps(workerProps).build();
+        Properties brokerProps = new Properties();
+
+        // Find a free port and use it in the Kafka broker's listeners config. 
We can't use port 0 in the listeners
+        // config to get a random free port because in this test we want to 
stop the Kafka broker and then bring it
+        // back up and listening on the same port in order to verify that the 
Connect cluster can re-connect to Kafka
+        // and continue functioning normally. If we were to use port 0 here, 
the Kafka broker would most likely listen
+        // on a different random free port the second time it is started.

Review Comment:
   > We're introducing a way to override the listeners property in the 
KafkaClusterTestKit class, but that only works for single-node clusters
   
   The override ability is also currently used for setting up SASL / SSL 
listeners (which can work in multi-node cases using port 0). 
   
   > IIUC it's not actually necessary to be able to override the listeners 
property for tests that involve changing the security protocols in use
   
   I think you're suggesting adding an API to the `KafkaClusterTestKit.Builder` 
class to be able to conveniently setup SASL / SSL listeners instead of each 
test setting all the individual listener related configs?



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to