kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2837 Follow-up: Default max block to 60 seconds
Date Tue, 15 Dec 2015 01:52:34 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk f3fc9e108 -> 901fe2eec


KAFKA-2837 Follow-up: Default max block to 60 seconds

Author: Guozhang Wang <wangguoz@gmail.com>

Reviewers: Ismael Juma

Closes #674 from guozhangwang/K2837


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

Branch: refs/heads/trunk
Commit: 901fe2eec272043236e149513b7cbce1b21f592d
Parents: f3fc9e1
Author: Guozhang Wang <wangguoz@gmail.com>
Authored: Mon Dec 14 17:52:27 2015 -0800
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Mon Dec 14 17:52:27 2015 -0800

----------------------------------------------------------------------
 .../kafka/api/ProducerFailureHandlingTest.scala | 24 ++++++++++----------
 .../test/scala/unit/kafka/utils/TestUtils.scala |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/901fe2ee/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala b/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
index 7b0910c..63a6b6f 100644
--- a/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
+++ b/core/src/test/scala/integration/kafka/api/ProducerFailureHandlingTest.scala
@@ -63,17 +63,17 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
   override def setUp() {
     super.setUp()
 
-    producer1 = TestUtils.createNewProducer(brokerList, acks = 0, maxBlockMs = 3000L, bufferSize
= producerBufferSize)
-    producer2 = TestUtils.createNewProducer(brokerList, acks = 1, maxBlockMs = 3000L, bufferSize
= producerBufferSize)
-    producer3 = TestUtils.createNewProducer(brokerList, acks = -1, maxBlockMs = 3000L, bufferSize
= producerBufferSize)
+    producer1 = TestUtils.createNewProducer(brokerList, acks = 0, maxBlockMs = 10000L, bufferSize
= producerBufferSize)
+    producer2 = TestUtils.createNewProducer(brokerList, acks = 1, maxBlockMs = 10000L, bufferSize
= producerBufferSize)
+    producer3 = TestUtils.createNewProducer(brokerList, acks = -1, maxBlockMs = 10000L, bufferSize
= producerBufferSize)
   }
 
   @After
   override def tearDown() {
-    if (producer1 != null) producer1.close
-    if (producer2 != null) producer2.close
-    if (producer3 != null) producer3.close
-    if (producer4 != null) producer4.close
+    if (producer1 != null) producer1.close()
+    if (producer2 != null) producer2.close()
+    if (producer3 != null) producer3.close()
+    if (producer4 != null) producer4.close()
 
     super.tearDown()
   }
@@ -134,7 +134,7 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
     TestUtils.createTopic(zkUtils, topic1, 1, numServers, servers)
 
     // producer with incorrect broker list
-    producer4 = TestUtils.createNewProducer("localhost:8686,localhost:4242", acks = 1, maxBlockMs
= 3000L, bufferSize = producerBufferSize)
+    producer4 = TestUtils.createNewProducer("localhost:8686,localhost:4242", acks = 1, maxBlockMs
= 10000L, bufferSize = producerBufferSize)
 
     // send a record with incorrect broker list
     val record = new ProducerRecord[Array[Byte],Array[Byte]](topic1, null, "key".getBytes,
"value".getBytes)
@@ -180,15 +180,15 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
     producer3.send(record).get
 
     intercept[IllegalStateException] {
-      producer1.close
+      producer1.close()
       producer1.send(record)
     }
     intercept[IllegalStateException] {
-      producer2.close
+      producer2.close()
       producer2.send(record)
     }
     intercept[IllegalStateException] {
-      producer3.close
+      producer3.close()
       producer3.send(record)
     }
 
@@ -280,7 +280,7 @@ class ProducerFailureHandlingTest extends KafkaServerTestHarness {
 
     override def shutdown(){
       super.shutdown()
-      producer.close
+      producer.close()
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/kafka/blob/901fe2ee/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 ecec866..3ef9714 100755
--- a/core/src/test/scala/unit/kafka/utils/TestUtils.scala
+++ b/core/src/test/scala/unit/kafka/utils/TestUtils.scala
@@ -455,7 +455,7 @@ object TestUtils extends Logging {
    */
   def createNewProducer(brokerList: String,
                         acks: Int = -1,
-                        maxBlockMs: Long = Long.MaxValue,
+                        maxBlockMs: Long = 60 * 1000L,
                         bufferSize: Long = 1024L * 1024L,
                         retries: Int = 0,
                         lingerMs: Long = 0,


Mime
View raw message