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:49:03 UTC
[kafka] branch trunk 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 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 5192956 MINOR: Improve verification in flaky testPartitionReassignmentDuringDeleteTopic (#6460)
5192956 is described below
commit 5192956581dad7eeb7796d51d85195102f151ab0
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 6e5ffc8..400920e 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()