Repository: kafka
Updated Branches:
  refs/heads/0.10.1 5006afe81 -> dc5fc239e


MINOR: Increase `zkConnectionTimeout` and timeout in `testReachableServer`

We had a number of failures recently due to these timeouts being too low. It's 
a particular problem if multiple forks are used while running the tests.

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

Reviewers: Jason Gustafson <ja...@confluent.io>

Closes #1889 from ijuma/increase-zk-timeout-in-tests

(cherry picked from commit d32f3f2828c199a5a09bbba779d07430e43fb190)
Signed-off-by: Jason Gustafson <ja...@confluent.io>


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

Branch: refs/heads/0.10.1
Commit: dc5fc239eef887c18db130ade65779b5821c737a
Parents: 5006afe
Author: Ismael Juma <ism...@juma.me.uk>
Authored: Thu Sep 22 14:53:40 2016 -0700
Committer: Jason Gustafson <ja...@confluent.io>
Committed: Thu Sep 22 14:54:06 2016 -0700

----------------------------------------------------------------------
 core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala | 4 ++--
 core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/dc5fc239/core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala 
b/core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala
index 270a794..968ea4b 100644
--- a/core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala
+++ b/core/src/test/scala/unit/kafka/producer/SyncProducerTest.scala
@@ -64,7 +64,7 @@ class SyncProducerTest extends KafkaServerTestHarness {
       case e: Exception => fail("Unexpected failure sending message to broker. 
" + e.getMessage)
     }
     val firstEnd = SystemTime.milliseconds
-    assertTrue((firstEnd-firstStart) < 500)
+    assertTrue((firstEnd-firstStart) < 2000)
     val secondStart = SystemTime.milliseconds
     try {
       val response = producer.send(produceRequest("test", 0,
@@ -74,7 +74,7 @@ class SyncProducerTest extends KafkaServerTestHarness {
       case e: Exception => fail("Unexpected failure sending message to broker. 
" + e.getMessage)
     }
     val secondEnd = SystemTime.milliseconds
-    assertTrue((secondEnd-secondStart) < 500)
+    assertTrue((secondEnd-secondStart) < 2000)
     try {
       val response = producer.send(produceRequest("test", 0,
         new ByteBufferMessageSet(compressionCodec = NoCompressionCodec, 
messages = new Message(messageBytes)), acks = 1))

http://git-wip-us.apache.org/repos/asf/kafka/blob/dc5fc239/core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala 
b/core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala
index 305e074..519b6fa 100755
--- a/core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala
+++ b/core/src/test/scala/unit/kafka/zk/ZooKeeperTestHarness.scala
@@ -25,7 +25,7 @@ import org.apache.kafka.common.security.JaasUtils
 
 trait ZooKeeperTestHarness extends JUnitSuite with Logging {
 
-  val zkConnectionTimeout = 6000
+  val zkConnectionTimeout = 10000
   val zkSessionTimeout = 6000
 
   var zkUtils: ZkUtils = null

Reply via email to