You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "brandboat (via GitHub)" <gi...@apache.org> on 2024/04/01 14:10:16 UTC

Re: [PR] [KAFKA-16435] Add test for KAFKA-16428 [kafka]

brandboat commented on code in PR #15635:
URL: https://github.com/apache/kafka/pull/15635#discussion_r1546370812


##########
core/src/test/scala/unit/kafka/zk/migration/ZkConfigMigrationClientTest.scala:
##########
@@ -112,10 +113,25 @@ class ZkConfigMigrationClientTest extends ZkMigrationTestHarness {
         assertEquals(newProps.get(key), value)
       }
     }
+    assertPathExistenceAndData("/config/changes/config_change_0000000000", """{"version":2,"entity_path":"brokers/1"}""")
 
     migrationState = migrationClient.configClient().deleteConfigs(
       new ConfigResource(ConfigResource.Type.BROKER, "1"), migrationState)
     assertEquals(0, zkClient.getEntityConfigs(ConfigType.BROKER, "1").size())
+    assertPathExistenceAndData("/config/changes/config_change_0000000001", """{"version":2,"entity_path":"brokers/1"}""")
+
+    // make sure there is no more config change notification in znode
+    assertFalse(zkClient.pathExists("/config/changes/config_change_0000000002"))
+  }
+
+  private def assertPathExistenceAndData(expectedPath: String, data: String): Unit = {
+    assertTrue(zkClient.pathExists(expectedPath))
+    assertEquals(Some(data), dataAsString(expectedPath))

Review Comment:
   @chia7712 , many thanks ! Already addressed the comment in the latest commit :smiley: 



-- 
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