This is an automated email from the ASF dual-hosted git repository.
schofielaj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 019459e950a MINOR: Remove unused erroneous code from test (#19585)
019459e950a is described below
commit 019459e950a3ec754ac7ec91f8d735bf7a918364
Author: Andrew Schofield <[email protected]>
AuthorDate: Mon Apr 28 18:41:50 2025 +0100
MINOR: Remove unused erroneous code from test (#19585)
This PR removes a small piece of unused code which is also not correct.
Reviewers: Apoorv Mittal <[email protected]>
---
.../kafka/server/ShareGroupHeartbeatRequestTest.scala | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)
diff --git
a/core/src/test/scala/unit/kafka/server/ShareGroupHeartbeatRequestTest.scala
b/core/src/test/scala/unit/kafka/server/ShareGroupHeartbeatRequestTest.scala
index 75b428ee0b4..77aae6c4d57 100644
--- a/core/src/test/scala/unit/kafka/server/ShareGroupHeartbeatRequestTest.scala
+++ b/core/src/test/scala/unit/kafka/server/ShareGroupHeartbeatRequestTest.scala
@@ -18,9 +18,8 @@ package kafka.server
import org.apache.kafka.common.test.api.{ClusterConfigProperty, ClusterTest,
ClusterTestDefaults, Type}
import kafka.utils.TestUtils
-import kafka.utils.TestUtils.waitForAllPartitionsMetadata
import org.apache.kafka.clients.admin.{Admin, NewPartitions}
-import org.apache.kafka.common.{TopicPartition, Uuid}
+import org.apache.kafka.common.Uuid
import org.apache.kafka.common.message.{ShareGroupHeartbeatRequestData,
ShareGroupHeartbeatResponseData}
import org.apache.kafka.common.protocol.Errors
import org.apache.kafka.common.requests.{ShareGroupHeartbeatRequest,
ShareGroupHeartbeatResponse}
@@ -524,7 +523,7 @@ class ShareGroupHeartbeatRequestTest(cluster:
ClusterInstance) {
// Verify the response.
assertEquals(5, shareGroupHeartbeatResponse.data.memberEpoch)
// Increasing the partitions of topic bar which is already being
consumed in the share group.
- increasePartitions(admin, "bar", 6, Seq.empty)
+ increasePartitions(admin, "bar", 6)
expectedAssignment = new ShareGroupHeartbeatResponseData.Assignment()
.setTopicPartitions(List(
@@ -876,20 +875,9 @@ class ShareGroupHeartbeatRequestTest(cluster:
ClusterInstance) {
private def increasePartitions[B <: KafkaBroker](admin: Admin,
topic: String,
- totalPartitionCount: Int,
- brokersToValidate: Seq[B]
+ totalPartitionCount: Int
): Unit = {
val newPartitionSet: Map[String, NewPartitions] = Map.apply(topic ->
NewPartitions.increaseTo(totalPartitionCount))
admin.createPartitions(newPartitionSet.asJava)
-
- if (brokersToValidate.nonEmpty) {
- // wait until we've propagated all partitions metadata to all brokers
- val allPartitionsMetadata =
waitForAllPartitionsMetadata(brokersToValidate, topic, totalPartitionCount)
- (0 until totalPartitionCount - 1).foreach(i => {
- allPartitionsMetadata.get(new TopicPartition(topic, i)).foreach {
partitionMetadata =>
- assertEquals(totalPartitionCount, partitionMetadata.isr.size)
- }
- })
- }
}
}