I think I found a problem with the EventHandler. The below spec will run forever.
Basically the EventHandler.info() will cause this. I tried calling EventHandler.shutdown() using the After spec. But, without luck. Do you think I’m missing something?
Akka: 1.3-RC1
class EventHandlerProblem extends Specification {
def is =
"This describes a possible problem with the EventHandler" ^
p ^
"The EventHandler should" ^
"not keep spinning forever...." ! e1
end
def e1 = {
// no need to start the actor
val ac = TestActorRef[PrintMessageActor]
true must beTrue
}
}
class PrintMessageActor extends Actor {
EventHandler.info(this, "Printer actor is starting up...")
def receive = {
case msg => {
println("Recieved: " + msg)
}
}
}
In my Akka Actor tests, I have a special trait which calls the
registry.shutdownAllafter running all of the fragments. This way, while you still need to be careful that your tests can run in parallel without stepping on each other, things get cleaned up after all the tests run. Here’s the trait: