Browse Source

Handle topic names with / on Kafka server; patched by Jun Rao; reviewed by Neha Narkhede; kafka-470

git-svn-id: https://svn.apache.org/repos/asf/incubator/kafka/branches/0.8@1381856 13f79535-47bb-0310-9956-ffa450edef68
0.8.0-beta1-candidate1
Jun Rao 12 years ago
parent
commit
259b710694
  1. 3
      core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala
  2. 1
      core/src/test/scala/unit/kafka/utils/TestUtils.scala

3
core/src/test/scala/unit/kafka/server/RequestPurgatoryTest.scala

@ -69,10 +69,9 @@ class RequestPurgatoryTest extends JUnit3Suite { @@ -69,10 +69,9 @@ class RequestPurgatoryTest extends JUnit3Suite {
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] {

1
core/src/test/scala/unit/kafka/utils/TestUtils.scala

@ -452,6 +452,7 @@ object TestUtils extends Logging { @@ -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")

Loading…
Cancel
Save