make failing test deterministic for RemoteDeathWatchSpec
This commit is contained in:
parent
255a8c74e9
commit
358da77ae3
1 changed files with 11 additions and 4 deletions
|
|
@ -34,16 +34,23 @@ trait DeathWatchSpec { this: AkkaSpec with ImplicitSender with DefaultTimeout
|
|||
|
||||
"notify with one Terminated message when an Actor is stopped" in {
|
||||
val terminal = system.actorOf(Props(context ⇒ { case _ ⇒ }))
|
||||
startWatching(terminal)
|
||||
|
||||
testActor ! "ping"
|
||||
expectMsg("ping")
|
||||
startWatching(terminal) ! "hallo"
|
||||
expectMsg("hallo") // this ensures that the DaemonMsgWatch has been received before we send the PoisonPill
|
||||
|
||||
terminal ! PoisonPill
|
||||
|
||||
expectTerminationOf(terminal)
|
||||
}
|
||||
|
||||
"notify with one Terminated message when an Actor is already dead" in {
|
||||
val terminal = system.actorOf(Props(context ⇒ { case _ ⇒ }))
|
||||
|
||||
terminal ! PoisonPill
|
||||
|
||||
startWatching(terminal)
|
||||
expectTerminationOf(terminal)
|
||||
}
|
||||
|
||||
"notify with all monitors with one Terminated message when an Actor is stopped" in {
|
||||
val terminal = system.actorOf(Props(context ⇒ { case _ ⇒ }))
|
||||
val monitor1, monitor2, monitor3 = startWatching(terminal)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue