You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by rs...@apache.org on 2019/03/18 16:56:01 UTC
[kafka] branch 2.2 updated: MINOR: Improve verification in flaky
testPartitionReassignmentDuringDeleteTopic (#6460)
This is an automated email from the ASF dual-hosted git repository.
rsivaram pushed a commit to branch 2.2
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.2 by this push:
new f4c8066 MINOR: Improve verification in flaky testPartitionReassignmentDuringDeleteTopic (#6460)
f4c8066 is described below
commit f4c8066c3b024eb02772321041ca7e15ef0a9d9b
Author: Anna Povzner <an...@confluent.io>
AuthorDate: Mon Mar 18 09:48:49 2019 -0700
MINOR: Improve verification in flaky testPartitionReassignmentDuringDeleteTopic (#6460)
Reviewers: Rajini Sivaram <ra...@googlemail.com>
---
core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala b/core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala
index 3f3e754..13005dc 100644
--- a/core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala
+++ b/core/src/test/scala/unit/kafka/admin/DeleteTopicTest.scala
@@ -138,8 +138,11 @@ class DeleteTopicTest extends ZooKeeperTestHarness {
}, "Partition reassignment shouldn't complete.")
val controllerId = zkClient.getControllerId.getOrElse(fail("Controller doesn't exist"))
val controller = servers.filter(s => s.config.brokerId == controllerId).head
- assertFalse("Partition reassignment should fail",
- controller.kafkaController.controllerContext.partitionsBeingReassigned.contains(topicPartition))
+
+ // partitionsBeingReassigned is updated after re-assignment znode is removed, so wait again
+ TestUtils.waitUntilTrue(() => {
+ !controller.kafkaController.controllerContext.partitionsBeingReassigned.contains(topicPartition)
+ }, "Partition should be removed from partitionsBeingReassigned.")
val assignedReplicas = zkClient.getReplicasForPartition(new TopicPartition(topic, 0))
assertEquals("Partition should not be reassigned to 0, 1, 2", oldAssignedReplicas, assignedReplicas)
follower.startup()