=rem #17440 Harden RemoteReDeploymentSpec

This commit is contained in:
Patrik Nordwall 2015-05-11 10:14:16 +02:00
parent 62f5f869a1
commit bd280e3252

View file

@ -1,3 +1,6 @@
/**
* Copyright (C) 2009-2015 Typesafe Inc. <http://www.typesafe.com>
*/
package akka.remote package akka.remote
import akka.remote.testkit.MultiNodeConfig import akka.remote.testkit.MultiNodeConfig
@ -97,15 +100,15 @@ abstract class RemoteReDeploymentMultiJvmSpec extends MultiNodeSpec(RemoteReDepl
"terminate the child when its parent system is replaced by a new one" in { "terminate the child when its parent system is replaced by a new one" in {
val echo = system.actorOf(echoProps(testActor), "echo") val echo = system.actorOf(echoProps(testActor), "echo")
val address = node(second).address enterBarrier("echo-started")
runOn(second) { runOn(second) {
system.actorOf(Props[Parent], "parent") ! ((Props[Hello], "hello")) system.actorOf(Props[Parent], "parent") ! ((Props[Hello], "hello"))
expectMsg("HelloParent") expectMsg(15.seconds, "HelloParent")
} }
runOn(first) { runOn(first) {
expectMsg("PreStart") expectMsg(15.seconds, "PreStart")
} }
enterBarrier("first-deployed") enterBarrier("first-deployed")
@ -136,14 +139,16 @@ abstract class RemoteReDeploymentMultiJvmSpec extends MultiNodeSpec(RemoteReDepl
val p = TestProbe()(sys) val p = TestProbe()(sys)
sys.actorOf(echoProps(p.ref), "echo") sys.actorOf(echoProps(p.ref), "echo")
p.send(sys.actorOf(Props[Parent], "parent"), (Props[Hello], "hello")) p.send(sys.actorOf(Props[Parent], "parent"), (Props[Hello], "hello"))
p.expectMsg("HelloParent") p.expectMsg(15.seconds, "HelloParent")
} }
enterBarrier("re-deployed") enterBarrier("re-deployed")
runOn(first) { runOn(first) {
if (expectQuarantine) expectMsg("PreStart") within(15.seconds) {
else expectMsgAllOf("PostStop", "PreStart") if (expectQuarantine) expectMsg("PreStart")
else expectMsgAllOf("PostStop", "PreStart")
}
} }
enterBarrier("the-end") enterBarrier("the-end")
@ -154,4 +159,4 @@ abstract class RemoteReDeploymentMultiJvmSpec extends MultiNodeSpec(RemoteReDepl
} }
} }