kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject svn commit: r1381856 - in /incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka: server/RequestPurgatoryTest.scala utils/TestUtils.scala
Date Fri, 07 Sep 2012 03:54:10 GMT
Author: junrao
Date: Fri Sep  7 03:54:10 2012
New Revision: 1381856

URL: http://svn.apache.org/viewvc?rev=1381856&view=rev
Log:
Handle topic names with / on Kafka server; patched by Jun Rao; reviewed by Neha Narkhede;
kafka-470

Modified:
    incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala
    incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/utils/TestUtils.scala

Modified: incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala?rev=1381856&r1=1381855&r2=1381856&view=diff
==============================================================================
--- incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala
(original)
+++ incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala
Fri Sep  7 03:54:10 2012
@@ -69,10 +69,9 @@ class RequestPurgatoryTest extends JUnit
     purgatory.watch(r2)
     purgatory.awaitExpiration(r1)
     val elapsed = System.currentTimeMillis - start
-    println(elapsed)
     assertTrue("r1 expired", purgatory.expired.contains(r1))
     assertTrue("r2 hasn't expired", !purgatory.expired.contains(r2))
-    assertTrue("Time for expiration was about 20ms", (elapsed - expiration).abs < 10L)
+    assertTrue("Time for expiration %d should at least %d".format(elapsed, expiration), elapsed
>= expiration)
   }
   
   class MockRequestPurgatory extends RequestPurgatory[DelayedRequest, ProducerRequest] {

Modified: incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/utils/TestUtils.scala
URL: http://svn.apache.org/viewvc/incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/utils/TestUtils.scala?rev=1381856&r1=1381855&r2=1381856&view=diff
==============================================================================
--- incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/utils/TestUtils.scala (original)
+++ incubator/kafka/branches/0.8/core/src/test/scala/unit/kafka/utils/TestUtils.scala Fri
Sep  7 03:54:10 2012
@@ -452,6 +452,7 @@ object TestUtils extends Logging {
         return true
       if (System.currentTimeMillis() > startTime + waitTime)
         return false
+      Thread.sleep(waitTime.min(100L))
     }
     // should never hit here
     throw new RuntimeException("unexpected error")



Mime
View raw message