Skip to content

Commit

Permalink
MINOR: Fix leak thread in DeleteTopicTest.testIncreasePartitionCountD…
Browse files Browse the repository at this point in the history
…uringDeleteTopic (apache#14960)

Reviewers: Lucas Brutschy <[email protected]>
  • Loading branch information
dajac authored Dec 8, 2023
1 parent 43c635f commit 0ad059d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -245,7 +246,6 @@ class DeleteTopicTest extends QuorumTestHarness {
follower.startup()
controller.startup()
TestUtils.verifyTopicDeletion(zkClient, topic, 2, servers)
adminClient.close()
}


Expand Down

0 comments on commit 0ad059d

Please sign in to comment.