Akka Scala TestKit test PoisonPill message
<p>Given that I have a <code>Supervisor</code> actor which is injected with a <code>child</code> actor how do I send the child a PoisonPill message and test this using TestKit?</p>

<p>Here is my Superivisor.</p>

<pre><code>class Supervisor(child: ActorRef) extends Actor {

  ...
  child ! "hello"
  child ! PoisonPill
}
</code></pre>

<p>here is my test code</p>

<pre><code>val probe = TestProbe()
val supervisor = system.actorOf(Props(classOf[Supervisor], probe.ref))
probe.expectMsg("hello")
probe.expectMsg(PoisonPill)
</code></pre>

<p>The problem is that the <code>PoisonPill</code> message is not received.
Possibly because the probe is terminated by the <code>PoisonPill</code> message?</p>

<p>The assertion fails with</p>

<pre><code>java.lang.AssertionError: assertion failed: timeout (3 seconds) 
during expectMsg while waiting for PoisonPill
</code></pre>