rondagostino commented on a change in pull request #11606: URL: https://github.com/apache/kafka/pull/11606#discussion_r782539950
########## File path: core/src/test/scala/unit/kafka/integration/KafkaServerTestHarness.scala ########## @@ -253,4 +248,32 @@ abstract class KafkaServerTestHarness extends QuorumTestHarness { getController().kafkaController.controllerContext.topicNames.toMap } + private def createBrokers(startup: Boolean): Unit = { + // Add each broker to `servers` buffer as soon as it is created to ensure that brokers + // are shutdown cleanly in tearDown even if a subsequent broker fails to start + for (config <- configs) { + val broker = createBrokerFromConfig(config) + _brokers += broker + if (startup) { + broker.startup() Review comment: This PR is not changing how this works in general, so this comment applies to the pre-PR implementation as well. I think the assumption is that the list of alive brokers is only valid if **all** brokers get created and are (now optionally) started -- and the test should be failed/torn down if an exception should occur that prevents all brokers from being processed. I'll add a comment to this effect in `recreateBrokers()` (which is the only place this gets invoked aside from in `setUp()`). -- 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