kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-6331; Fix transient failure in AdminClientIntegrationTest.testAlterReplicaLogDirs
Date Wed, 20 Dec 2017 12:02:08 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 82c6d429e -> cdb395545


KAFKA-6331; Fix transient failure in AdminClientIntegrationTest.testAlterReplicaLogDirs

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #4306 from lindong28/KAFKA-6331


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/cdb39554
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/cdb39554
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/cdb39554

Branch: refs/heads/trunk
Commit: cdb39554527a59d436d5b6b26967f14adfae072f
Parents: 82c6d42
Author: Dong Lin <lindong28@gmail.com>
Authored: Wed Dec 20 12:01:22 2017 +0000
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed Dec 20 12:01:36 2017 +0000

----------------------------------------------------------------------
 .../kafka/api/AdminClientIntegrationTest.scala            | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/cdb39554/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala b/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
index 0676a1a..14e26df 100644
--- a/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
+++ b/core/src/test/scala/integration/kafka/api/AdminClientIntegrationTest.scala
@@ -327,7 +327,7 @@ class AdminClientIntegrationTest extends IntegrationTestHarness with Logging
{
       TestUtils.waitUntilTrue(() => {
         val logDir = server.logManager.getLog(tp).get.dir.getParent
         secondReplicaAssignment(new TopicPartitionReplica(topic, 0, server.config.brokerId))
== logDir
-      }, "timed out waiting for replica movement", 6000L)
+      }, "timed out waiting for replica movement")
     }
 
     // Verify that replica can be moved to the specified log directory while the producer
is sending messages
@@ -354,14 +354,18 @@ class AdminClientIntegrationTest extends IntegrationTestHarness with
Logging {
     }
 
     try {
-      TestUtils.waitUntilTrue(() => numMessages.get > 100, "timed out waiting for message
produce", 6000L)
+      TestUtils.waitUntilTrue(() => numMessages.get > 10, s"only $numMessages messages
are produced before timeout. Producer future ${producerFuture.value}")
       client.alterReplicaLogDirs(firstReplicaAssignment.asJava, new AlterReplicaLogDirsOptions).all.get
       servers.foreach { server =>
         TestUtils.waitUntilTrue(() => {
           val logDir = server.logManager.getLog(tp).get.dir.getParent
           firstReplicaAssignment(new TopicPartitionReplica(topic, 0, server.config.brokerId))
== logDir
-        }, "timed out waiting for replica movement", 6000L)
+        }, s"timed out waiting for replica movement. Producer future ${producerFuture.value}")
       }
+
+      val currentMessagesNum = numMessages.get
+      TestUtils.waitUntilTrue(() => numMessages.get - currentMessagesNum > 10,
+        s"only ${numMessages.get - currentMessagesNum} messages are produced within timeout
after replica movement. Producer future ${producerFuture.value}")
     } finally running.set(false)
 
     val finalNumMessages = Await.result(producerFuture, Duration(20, TimeUnit.SECONDS))


Mime
View raw message