MINOR: Fix leak thread in DeleteTopicTest.testIncreasePartitionCountDuringDeleteTopic (#14960)

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
This commit is contained in:
David Jacot 2023-12-08 13:34:26 +01:00 committed by GitHub
parent 43c635f3a4
commit 0ad059d101
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -223,11 +223,12 @@ class DeleteTopicTest extends QuorumTestHarness {
// increase the partition count for topic
val props = new Properties()
props.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, TestUtils.plaintextBootstrapServers(servers))
val adminClient = Admin.create(props)
try {
adminClient.createPartitions(Map(topic -> NewPartitions.increaseTo(2)).asJava).all().get()
} catch {
case _: ExecutionException =>
TestUtils.resource(Admin.create(props)) { adminClient =>
try {
adminClient.createPartitions(Map(topic -> NewPartitions.increaseTo(2)).asJava).all().get()
} catch {
case _: ExecutionException =>
}
}
// trigger a controller switch now
val previousControllerId = controllerId
@ -245,7 +246,6 @@ class DeleteTopicTest extends QuorumTestHarness {
follower.startup()
controller.startup()
TestUtils.verifyTopicDeletion(zkClient, topic, 2, servers)
adminClient.close()
}