kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: MINOR: Increase default timeout for other `wait` methods in `TestUtils`
Date Tue, 26 Jul 2016 23:40:48 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 801fee89d -> 1e1c164cf


MINOR: Increase default timeout for other `wait` methods in `TestUtils`

They are now consistent with `waitUntilTrue`.

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

Reviewers: Guozhang Wang <wangguoz@gmail.com>

Closes #1665 from ijuma/increase-default-wait-until-time


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

Branch: refs/heads/trunk
Commit: 1e1c164cfa58d225c38de9f8aea3c666a9464808
Parents: 801fee8
Author: Ismael Juma <ismael@juma.me.uk>
Authored: Wed Jul 27 00:40:42 2016 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed Jul 27 00:40:42 2016 +0100

----------------------------------------------------------------------
 core/src/test/scala/unit/kafka/utils/TestUtils.scala | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/1e1c164c/core/src/test/scala/unit/kafka/utils/TestUtils.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/utils/TestUtils.scala b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
index dccdc7d..05b84ef 100755
--- a/core/src/test/scala/unit/kafka/utils/TestUtils.scala
+++ b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
@@ -674,7 +674,8 @@ object TestUtils extends Logging {
    *
    * @return The new leader or assertion failure if timeout is reached.
    */
-  def waitUntilLeaderIsElectedOrChanged(zkUtils: ZkUtils, topic: String, partition: Int,
timeoutMs: Long = 5000L,
+  def waitUntilLeaderIsElectedOrChanged(zkUtils: ZkUtils, topic: String, partition: Int,
+                                        timeoutMs: Long = JTestUtils.DEFAULT_MAX_WAIT_MS,
                                         oldLeaderOpt: Option[Int] = None, newLeaderOpt: Option[Int]
= None): Option[Int] = {
     require(!(oldLeaderOpt.isDefined && newLeaderOpt.isDefined), "Can't define both
the old and the new leader")
     val startTime = System.currentTimeMillis()
@@ -786,7 +787,8 @@ object TestUtils extends Logging {
    * @param timeout The amount of time waiting on this condition before assert to fail
    * @return The leader of the partition.
    */
-  def waitUntilMetadataIsPropagated(servers: Seq[KafkaServer], topic: String, partition:
Int, timeout: Long = 5000L): Int = {
+  def waitUntilMetadataIsPropagated(servers: Seq[KafkaServer], topic: String, partition:
Int,
+                                    timeout: Long = JTestUtils.DEFAULT_MAX_WAIT_MS): Int
= {
     var leader: Int = -1
     TestUtils.waitUntilTrue(() =>
       servers.foldLeft(true) {
@@ -805,7 +807,8 @@ object TestUtils extends Logging {
     leader
   }
 
-  def waitUntilLeaderIsKnown(servers: Seq[KafkaServer], topic: String, partition: Int, timeout:
Long = 5000L): Unit = {
+  def waitUntilLeaderIsKnown(servers: Seq[KafkaServer], topic: String, partition: Int,
+                             timeout: Long = JTestUtils.DEFAULT_MAX_WAIT_MS): Unit = {
     TestUtils.waitUntilTrue(() =>
       servers.exists { server =>
         server.replicaManager.getPartition(topic, partition).exists(_.leaderReplicaIfLocal().isDefined)
@@ -1073,7 +1076,7 @@ object TestUtils extends Logging {
 
   def waitAndVerifyAcls(expected: Set[Acl], authorizer: Authorizer, resource: Resource) =
{
     TestUtils.waitUntilTrue(() => authorizer.getAcls(resource) == expected,
-      s"expected acls $expected but got ${authorizer.getAcls(resource)}", waitTime = 10000)
+      s"expected acls $expected but got ${authorizer.getAcls(resource)}", waitTime = JTestUtils.DEFAULT_MAX_WAIT_MS)
   }
 
   /**


Mime
View raw message