unknowntpo commented on code in PR #16687: URL: https://github.com/apache/kafka/pull/16687#discussion_r1712922851
########## core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala: ########## @@ -95,6 +96,35 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest { super.tearDown() } + @ParameterizedTest + @ValueSource(strings = Array("zk", "kraft")) + def testCreatePartitionWithOptionRetryOnQuotaViolation(): Unit = { + // Since it's hard to stably reach quota limit in integration test, we only verify quota configs are set correctly + val config = createConfig + val clientId = "test-client-id" + + config.put(AdminClientConfig.CLIENT_ID_CONFIG, clientId) + client = AdminClientTestUtils.create(config, null) + + val entity = new ClientQuotaEntity(Map(ClientQuotaEntity.CLIENT_ID -> clientId).asJava) + + val configEntries = Map(QuotaConfigs.CONTROLLER_MUTATION_RATE_OVERRIDE_CONFIG -> 1.0, QuotaConfigs.CONSUMER_BYTE_RATE_OVERRIDE_CONFIG -> 3.0) + val quotas = configEntries.map {case (k, v) => new ClientQuotaAlteration.Op(k,v)} Review Comment: Elegant! -- 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