Your test will execute on a separate thread to your actor. You'll want to use Akka's test kit. Here's a sample:

https://github.com/sbt/sbt-jshint-plugin/blob/master/src/test/scala/com/typesafe/jshint/JshinterSpec.scala#L31

On 13/02/2014, at 10:27 AM, James Ward <notifications@github.com> wrote:

> In framework/src/play/src/test/scala/play/api/libs/concurrent/AkkaSpec.scala:
> 
> > +      
> > +      val endTime = new Date
> > +      
> > +      // the actor blocks for 30 seconds but we should be back here in less than a second
> > +      (endTime.getTime - startTime.getTime) must be lessThan 1000
> > +    }
> > +  }
> > +
> > +}
> > +
> > +class BlockingActor extends Actor {
> > +  
> > +  def receive = {
> > +    case Block =>
> > +      context.system.log.info("BlockingActor is now blocking for 30 seconds")
> > +      Thread.sleep(30000)
> In my tests it isn't blocking the tests from exiting. But I'm not sure how...
> 
> —
> Reply to this email directly or view it on GitHub.
>