kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-1377; transient unit test failure in LogOffsetTest; patched by Jun Rao; reviewed by Neha Narkhede
Date Sat, 12 Apr 2014 20:47:19 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 6bb616e5a -> 05612ac44


kafka-1377; transient unit test failure in LogOffsetTest; patched by Jun Rao; reviewed by
Neha Narkhede


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

Branch: refs/heads/trunk
Commit: 05612ac44de775cf3bc8ffdc15c033920d4a1440
Parents: 6bb616e
Author: Jun Rao <junrao@gmail.com>
Authored: Sat Apr 12 13:47:13 2014 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Sat Apr 12 13:47:13 2014 -0700

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


http://git-wip-us.apache.org/repos/asf/kafka/blob/05612ac4/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala b/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
index e102285..521d156 100644
--- a/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
+++ b/core/src/test/scala/unit/kafka/server/LogOffsetTest.scala
@@ -86,7 +86,7 @@ class LogOffsetTest extends JUnit3Suite with ZooKeeperTestHarness {
 
     val logManager = server.getLogManager
     assertTrue("Log for partition [topic,0] should be created",
-      waitUntilTrue(() => logManager.getLog(TopicAndPartition(topic, part)).isDefined,
1000))
+      waitUntilTrue(() => logManager.getLog(TopicAndPartition(topic, part)).isDefined,
5000))
     val log = logManager.getLog(TopicAndPartition(topic, part)).get
 
     val message = new Message(Integer.toString(42).getBytes())
@@ -97,7 +97,8 @@ class LogOffsetTest extends JUnit3Suite with ZooKeeperTestHarness {
     val offsets = server.apis.fetchOffsets(logManager, TopicAndPartition(topic, part), OffsetRequest.LatestTime,
10)
     assertEquals(Seq(20L, 16L, 12L, 8L, 4L, 0L), offsets)
 
-    waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 1000)
+    assertTrue("Leader should be elected",
+      waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 5000))
     val topicAndPartition = TopicAndPartition(topic, part)
     val offsetRequest = OffsetRequest(
       Map(topicAndPartition -> PartitionOffsetRequestInfo(OffsetRequest.LatestTime, 10)),
@@ -161,7 +162,8 @@ class LogOffsetTest extends JUnit3Suite with ZooKeeperTestHarness {
     val offsets = server.apis.fetchOffsets(logManager, TopicAndPartition(topic, part), now,
10)
     assertEquals(Seq(20L, 16L, 12L, 8L, 4L, 0L), offsets)
 
-    waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 1000)
+    assertTrue("Leader should be elected",
+      waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 5000))
     val topicAndPartition = TopicAndPartition(topic, part)
     val offsetRequest = OffsetRequest(Map(topicAndPartition -> PartitionOffsetRequestInfo(now,
10)), replicaId = 0)
     val consumerOffsets =
@@ -189,7 +191,8 @@ class LogOffsetTest extends JUnit3Suite with ZooKeeperTestHarness {
 
     assertEquals(Seq(0L), offsets)
 
-    waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 1000)
+    assertTrue("Leader should be elected",
+      waitUntilTrue(() => isLeaderLocalOnBroker(topic, part, server), 5000))
     val topicAndPartition = TopicAndPartition(topic, part)
     val offsetRequest =
       OffsetRequest(Map(topicAndPartition -> PartitionOffsetRequestInfo(OffsetRequest.EarliestTime,
10)))


Mime
View raw message