diff options
author | Ivan Topolnak <ivantopo@gmail.com> | 2013-09-30 11:21:25 -0300 |
---|---|---|
committer | Ivan Topolnak <ivantopo@gmail.com> | 2013-09-30 11:21:25 -0300 |
commit | d7f1e195da11f977d5fdbf74598e499156de8dc4 (patch) | |
tree | 58b6650bcc01c38f0cfb6fb32bbf4921d4c4b79f /kamon-core/src/test/scala | |
parent | 604d5801332838f8bea25fe25cb8df5dbb82af08 (diff) | |
download | Kamon-d7f1e195da11f977d5fdbf74598e499156de8dc4.tar.gz Kamon-d7f1e195da11f977d5fdbf74598e499156de8dc4.tar.bz2 Kamon-d7f1e195da11f977d5fdbf74598e499156de8dc4.zip |
wip
Diffstat (limited to 'kamon-core/src/test/scala')
-rw-r--r-- | kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala b/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala index ccc7740b..454b4514 100644 --- a/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala +++ b/kamon-core/src/test/scala/akka/instrumentation/ActorInstrumentationSpec.scala @@ -8,6 +8,7 @@ import kamon.{TraceContext, Tracer} import akka.pattern.{pipe, ask} import akka.util.Timeout import scala.concurrent.duration._ +import scala.concurrent.{Await, Future} import akka.routing.RoundRobinRouter @@ -35,11 +36,30 @@ class ActorInstrumentationSpec extends TestKit(ActorSystem("ActorInstrumentation expectMsg(Some(testTraceContext)) } - "propagate the trace context to actors behind a rounter" in new RoutedTraceContextEchoFixture { + "propagate the trace context to actors behind a router" in new RoutedTraceContextEchoFixture { val contexts: Seq[Option[TraceContext]] = for(_ <- 1 to 10) yield Some(tellWithNewContext(echo, "test")) expectMsgAllOf(contexts: _*) } + + "propagate with many asks" in { + val echo = system.actorOf(Props[TraceContextEcho]) + val iterations = 50000 + implicit val timeout = Timeout(10 seconds) + + val futures = for(_ <- 1 to iterations) yield { + Tracer.start + val result = (echo ? "test") + Tracer.clear + + result + } + + val allResults = Await.result(Future.sequence(futures), 10 seconds) + assert(iterations == allResults.collect { + case Some(_) => 1 + }.sum) + } } } |