I'm writing tests for an actor that monitors a child actor. If the child
actor dies, the monitor also stops.
Since upgrading to Akka-2.2, I get a warning message when running the test
(most of the time...):
[default-akka.actor.default-dispatcher-2] [akka://default/user/Monitor]
Message [akka.dispatch.sysmsg.DeathWatchNotification] from
TestActor[akka://default/user/Monitor] to
TestActor[akka://default/user/Monitor] was not delivered. [1] dead letters
encountered.
I'm wondering why the actor appears to be sending a DeathWatchNotification
to itself, and why it is not delivered, since the test itself checks that
the actor dies.
The test code:
"monitor the quick and the dead" in new ActorSystemContext {
val monitor = TestProbe()
val a = TestActorRef(new MonitoringActor, "Monitor")
monitor.watch(a)
a ! "hi!"
monitor.expectTerminated(a)
}
The actors (minimal versions of actual code):
class DyingActor extends Actor {
def receive = {
case _ => context.stop(self)
}
}
class MonitoringActor extends Actor {
def receive = {
case Terminated(a) => context.stop(self)
case _ => {
val dyingActor = context.actorOf(Props(new DyingActor))
context.watch(dyingActor)
dyingActor ! "hi"
}
}
}
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.