You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/05/04 18:30:43 UTC

[GitHub] [kafka] akhileshchg commented on a diff in pull request #12108: KAFKA-13862: Support Append/Subtract multiple config values in KRaft mode

akhileshchg commented on code in PR #12108:
URL: https://github.com/apache/kafka/pull/12108#discussion_r865146433


##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -1751,13 +1777,32 @@ class PlaintextAdminIntegrationTest extends BaseAdminIntegrationTest {
       new AlterConfigOp(new ConfigEntry(LogConfig.CleanupPolicyProp, LogConfig.Compact + "," + LogConfig.Delete), AlterConfigOp.OpType.SUBTRACT)
     ).asJavaCollection
 
-    alterResult = client.incrementalAlterConfigs(Map(
+    alterConfigs = Map(
       topic1Resource -> topic1AlterConfigs,
       topic2Resource -> topic2AlterConfigs
-    ).asJava)
+    )
+    alterResult = client.incrementalAlterConfigs(alterConfigs.asJava)
     assertEquals(Set(topic1Resource, topic2Resource).asJava, alterResult.values.keySet)
     alterResult.all.get
 
+    if (isKRaftTest()) {

Review Comment:
   I think this can be a util function:
   ```
   TestUtils.waitForMetadataPropagation(brokers, condition: KRaftMetadataCache => Boolean): Unit = {
     assertTrue(isKRaftTest())
     TestUtils.waitUntilTrue(() => {
       brokers.forall { broker => condition(broker.metadataCache.asInstanceOf[KRaftMetadataCache])
     }, "Metadata is not propgated to all brokers")
   }
   ```
   
   and we can call it as:
   ```
   TestUtils.waitForMetadataPropagation(brokers, metadataCache => {
     // validation logic.
   })
   ```



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

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