hachikuji commented on a change in pull request #11629: URL: https://github.com/apache/kafka/pull/11629#discussion_r779218571
########## File path: core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala ########## @@ -80,6 +81,19 @@ abstract class IntegrationTestHarness extends KafkaServerTestHarness { } } + private def insertControllerListenersIfNeeded(props: Seq[Properties]): Unit = { Review comment: nit: seems like this would be a bit more natural in `configureListeners` where we already have logic to construct the security map. ########## File path: core/src/test/scala/integration/kafka/api/IntegrationTestHarness.scala ########## @@ -80,6 +81,19 @@ abstract class IntegrationTestHarness extends KafkaServerTestHarness { } } + private def insertControllerListenersIfNeeded(props: Seq[Properties]): Unit = { + if (isKRaftTest()) { + props.foreach { config => + // Add a security protocol for the CONTROLLER endpoint, if one is not already set. + val securityPairs = config.getProperty(KafkaConfig.ListenerSecurityProtocolMapProp, "").split(",") + if (!securityPairs.exists(_.startsWith("CONTROLLER:"))) { Review comment: nit: maybe we could pull the controller listener name from the config to make this logic a bit more general ########## File path: core/src/test/scala/unit/kafka/server/CreateTopicsRequestTest.scala ########## @@ -99,29 +101,33 @@ class CreateTopicsRequestTest extends AbstractCreateTopicsRequestTest { ) validateTopicExists("partial-none") - // Timeout - // We don't expect a request to ever complete within 1ms. A timeout of 1 ms allows us to test the purgatory timeout logic. - validateErrorCreateTopicsRequests(topicsReq(Seq( - topicReq("error-timeout", numPartitions = 10, replicationFactor = 3)), timeout = 1), - Map("error-timeout" -> error(Errors.REQUEST_TIMED_OUT)), checkErrorMessage = false) - validateErrorCreateTopicsRequests(topicsReq(Seq( - topicReq("error-timeout-zero", numPartitions = 10, replicationFactor = 3)), timeout = 0), - Map("error-timeout-zero" -> error(Errors.REQUEST_TIMED_OUT)), checkErrorMessage = false) - // Negative timeouts are treated the same as 0 - validateErrorCreateTopicsRequests(topicsReq(Seq( - topicReq("error-timeout-negative", numPartitions = 10, replicationFactor = 3)), timeout = -1), - Map("error-timeout-negative" -> error(Errors.REQUEST_TIMED_OUT)), checkErrorMessage = false) - // The topics should still get created eventually - TestUtils.waitForPartitionMetadata(servers, "error-timeout", 0) - TestUtils.waitForPartitionMetadata(servers, "error-timeout-zero", 0) - TestUtils.waitForPartitionMetadata(servers, "error-timeout-negative", 0) - validateTopicExists("error-timeout") - validateTopicExists("error-timeout-zero") - validateTopicExists("error-timeout-negative") + if (!isKRaftTest()) { Review comment: nit: maybe we can pull this into a separate test case since it is specific to zk and it doesn't seem to depend on the any of the logic above. -- 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