@@ -203,26 +203,34 @@ class ActivationClientProxyTests
203
203
val client = (_ : String , _ : FullyQualifiedEntityName , _ : String , _ : Int , _ : Boolean ) =>
204
204
Future (MockActivationServiceClient (fetch))
205
205
206
- val probe = TestProbe ()
206
+ val parentProbe = TestProbe ()
207
+ val selfProbe = TestProbe ()
207
208
val machine =
208
- probe .childActorOf(
209
+ parentProbe .childActorOf(
209
210
ActivationClientProxy
210
211
.props(invocationNamespace.asString, fqn, rev, schedulerHost, rpcPort, containerId, client))
211
- registerCallback(machine, probe)
212
- ready(machine, probe)
212
+
213
+ // set up watch of client proxy fsm
214
+ machine ! SubscribeTransitionCallBack (selfProbe.ref)
215
+ selfProbe.expectMsg(CurrentState (machine, ClientProxyUninitialized ))
216
+ selfProbe watch machine
217
+
218
+ // wait for client proxy to be ready
219
+ machine ! StartClient
220
+ parentProbe.expectMsg(ClientCreationCompleted )
221
+ selfProbe.expectMsg(Transition (machine, ClientProxyUninitialized , ClientProxyReady ))
213
222
214
223
machine ! RequestActivation ()
215
224
216
- inAnyOrder {
217
- probe.expectMsg(Transition (machine, ClientProxyReady , ClientProxyRemoving ))
218
- probe.expectMsgPF() {
219
- case Failure (t) => t.getMessage.contains(s " action version does not match " ) shouldBe true
220
- }
225
+ // next two events can happen in any order
226
+ selfProbe.expectMsg(Transition (machine, ClientProxyReady , ClientProxyRemoving ))
227
+ parentProbe.expectMsgPF() {
228
+ case Failure (t) => t.getMessage.contains(s " action version does not match " ) shouldBe true
221
229
}
222
230
223
- probe .expectMsg(ClientClosed )
231
+ parentProbe .expectMsg(ClientClosed )
224
232
225
- probe expectTerminated machine
233
+ selfProbe expectTerminated machine
226
234
}
227
235
228
236
it should " retry to request activation message when scheduler response no activation message" in within(timeout) {
0 commit comments