fvaleri commented on code in PR #17524:
URL: https://github.com/apache/kafka/pull/17524#discussion_r1829773050
##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -615,6 +615,42 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
assertEquals(brokerStrs.mkString(","), nodeStrs.mkString(","))
}
+ @ParameterizedTest
+ @ValueSource(strings = Array("kraft"))
+ def testListNodesNotIncludingFencedBrokers(quorum: String): Unit = {
+ client = createAdminClient
+ val fencedBrokerId = brokers.last.config.brokerId
+ killBroker(fencedBrokerId)
+ Thread.sleep(10000) //sleep is needed to ensure the broker is fenced after
the shutdown
Review Comment:
Is there any way to avoid this? My fear is that it can create a flaky test
when you have a slow environment, like when you run along with a bunch of other
tests on the pipeline.
##########
core/src/test/scala/integration/kafka/api/PlaintextAdminIntegrationTest.scala:
##########
@@ -615,6 +615,42 @@ class PlaintextAdminIntegrationTest extends
BaseAdminIntegrationTest {
assertEquals(brokerStrs.mkString(","), nodeStrs.mkString(","))
}
+ @ParameterizedTest
+ @ValueSource(strings = Array("kraft"))
+ def testListNodesNotIncludingFencedBrokers(quorum: String): Unit = {
+ client = createAdminClient
+ val fencedBrokerId = brokers.last.config.brokerId
+ killBroker(fencedBrokerId)
+ Thread.sleep(10000) //sleep is needed to ensure the broker is fenced after
the shutdown
+
+ val nodes = client.describeCluster().nodes().get().asScala
+ assertTrue(nodes.size.equals(brokers.size - 1))
+ nodes.foreach(node => {
+ assertFalse(node.isFenced)
+ assertFalse(node.id().equals(fencedBrokerId))
+ })
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = Array("kraft"))
+ def testListNodesIncludingFencedBrokers(quorum: String): Unit = {
+ client = createAdminClient
+ val fencedBrokerId = brokers.last.config.brokerId
+ killBroker(fencedBrokerId)
+ Thread.sleep(10000) //sleep is needed to ensure the broker is fenced after
the shutdown
Review Comment:
See the other similar comment.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]