make Jenkins wait for Davy Jones

- AkkaSpecSpec failed with nothing in the locker, but only on Jenkins
- cause: Davy Jones doesn’t get a chance to run because nobody actually
  waits for his processing
- thus, give him permission to leave this world and have him confirm
  that
This commit is contained in:
Roland 2011-12-06 22:50:19 +01:00
parent a1d8f30669
commit c4ed57100e

View file

@ -128,6 +128,7 @@ class AkkaSpecSpec extends WordSpec with MustMatchers {
implicit val davyJones = otherSystem.actorOf(Props(new Actor { implicit val davyJones = otherSystem.actorOf(Props(new Actor {
def receive = { def receive = {
case m: DeadLetter locker :+= m case m: DeadLetter locker :+= m
case "Die!" sender ! "finally gone"; self.stop()
} }
}), "davyJones") }), "davyJones")
@ -148,6 +149,7 @@ class AkkaSpecSpec extends WordSpec with MustMatchers {
system.registerOnTermination(latch.countDown()) system.registerOnTermination(latch.countDown())
system.stop() system.stop()
latch.await(2 seconds) latch.await(2 seconds)
(davyJones ? "Die!").get must be === "finally gone"
// this will typically also contain log messages which were sent after the logger shutdown // this will typically also contain log messages which were sent after the logger shutdown
locker must contain(DeadLetter(42, davyJones, probe.ref)) locker must contain(DeadLetter(42, davyJones, probe.ref))