Skip to content

Commit

Permalink
=con akka#16946 Make ReliableProxyMultiJvmSpec not reuse actor name
Browse files Browse the repository at this point in the history
  • Loading branch information
bantonsson committed Mar 26, 2015
1 parent 7aa9fe2 commit cdb7eee
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
}

def stopProxy(): Unit = {
proxy ! FSM.UnsubscribeTransitionCallBack(testActor)
system stop proxy
expectMsgType[Terminated]
val currentProxy = proxy
currentProxy ! FSM.UnsubscribeTransitionCallBack(testActor)
currentProxy ! PoisonPill
expectTerminated(currentProxy)
}

def expectState(s: State) = expectMsg(FSM.CurrentState(proxy, s))
Expand Down Expand Up @@ -91,7 +92,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
import akka.contrib.pattern.ReliableProxy

idTarget()
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis, 5.seconds), "proxy")
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis, 5.seconds), "proxy1")
watch(proxy)
proxy ! FSM.SubscribeTransitionCallBack(testActor)
expectState(Connecting)
Expand Down Expand Up @@ -289,7 +290,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
stopProxy() // Stop previous proxy

// Start new proxy with no reconnections
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis), "proxy")
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis), "proxy2")
proxy ! FSM.SubscribeTransitionCallBack(testActor)
watch(proxy)

Expand All @@ -308,7 +309,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
runOn(local) {
within(5 seconds) {
expectMsgType[ProxyTerminated]
expectMsgType[Terminated]
expectTerminated(proxy)
}
}

Expand All @@ -332,7 +333,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
runOn(local) {
// Proxy is not running after previous test
// Start new proxy with 3 reconnections every 2 sec
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis, 2.seconds, 3), "proxy")
proxy = system.actorOf(ReliableProxy.props(target.path, 100.millis, 2.seconds, 3), "proxy3")
proxy ! FSM.SubscribeTransitionCallBack(testActor)
watch(proxy)
expectState(Connecting)
Expand Down Expand Up @@ -364,7 +365,7 @@ class ReliableProxySpec extends MultiNodeSpec(ReliableProxySpec) with STMultiNod
// Validate that the unsent messages are 50 ints
val unsentInts = proxyTerm.outstanding.queue collect { case Message(i: Int, _, _) if i > 0 && i <= 50 i }
unsentInts should have size 50
expectMsgType[Terminated]
expectTerminated(proxy)
}
}

Expand Down

0 comments on commit cdb7eee

Please sign in to comment.