Skip to content

Commit

Permalink
Merge pull request akka#1426 from akka/wip-3313-ConsumerIntegrationTe…
Browse files Browse the repository at this point in the history
…st-timing-sensitive-√

 #3313 - Relaxing the timing of the consumer timeout and marking the tes...
  • Loading branch information
viktorklang committed May 10, 2013
2 parents a5c9147 + f049ea4 commit e73cc01
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ class ConsumerIntegrationTest extends WordSpec with MustMatchers with NonSharedC
camel.sendTo("direct:a1", msg = "some message") must be("received some message")
}

"Consumer must time-out if consumer is slow" in {
"Consumer must time-out if consumer is slow" taggedAs TimingTest in {
val SHORT_TIMEOUT = 10 millis
val LONG_WAIT = 200 millis
val LONG_WAIT = 1 second

val ref = start(new Consumer {
override def replyTimeout = SHORT_TIMEOUT

def endpointUri = "direct:a3"
def receive = { case _ { Thread.sleep(LONG_WAIT.toMillis); sender ! "done" } }
}, name = "ignore-this-deadletter-timeout-consumer-reply")

val exception = intercept[CamelExecutionException] {
intercept[CamelExecutionException] {
camel.sendTo("direct:a3", msg = "some msg 3")
}
exception.getCause.getClass must be(classOf[TimeoutException])
}.getCause.getClass must be(classOf[TimeoutException])

stop(ref)
}

Expand Down

0 comments on commit e73cc01

Please sign in to comment.