Skip to content

Conversation

@jack2012aa
Copy link
Contributor

Description

Changed MetadataRequestTest to use ClusterTest

Changes

Added ClusterInstance#createTopicWithAssignment to align with KafkaServerTestHarness#createTopicWithAssignment

Helper functions inherited from base classes were rewritten in AbstractMetadataRequestTest

Issue

testIsrAfterBrokerShutDownAndJoinsBack fails because of thread leak:

org.opentest4j.AssertionFailedError: Thread leak detected: JMX server connection timeout 28 ==> 
Expected :true
Actual   :false

testAliveBrokersWithNoTopics would also fail if the last checkMetadata is removed.

# Conflicts:
#	core/src/test/scala/unit/kafka/server/MetadataRequestTest.scala
@github-actions github-actions bot added triage PRs from the community core Kafka Broker tests Test fixes (including flaky tests) labels Dec 7, 2025
@jack2012aa jack2012aa marked this pull request as ready for review December 8, 2025 18:56
import scala.jdk.CollectionConverters.{CollectionHasAsScala, MapHasAsJava, SeqHasAsJava}

override def brokerPropertyOverrides(properties: Properties): Unit = {
abstract class AbstractMetadataRequestTest(cluster: ClusterInstance) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since AbstractMetadataRequestTest is only used by MetadataRequestTest. Perhaps we could merge the two files together?

new ClusterConfigProperty(id = 2, key = "broker.rack", value = "rack/2")
)
)
class MetadataRequestTest(cluster: ClusterInstance) extends AbstractMetadataRequestTest(cluster) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rewrite it by java. Also, please move it to server module

@github-actions github-actions bot removed the triage PRs from the community label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants