style95 commented on code in PR #5382:
URL: https://github.com/apache/openwhisk/pull/5382#discussion_r1109077290
##########
tests/src/test/scala/org/apache/openwhisk/core/containerpool/v2/test/ActivationClientProxyTests.scala:
##########
@@ -203,26 +203,34 @@ class ActivationClientProxyTests
val client = (_: String, _: FullyQualifiedEntityName, _: String, _: Int,
_: Boolean) =>
Future(MockActivationServiceClient(fetch))
- val probe = TestProbe()
+ val parentProbe = TestProbe()
+ val selfProbe = TestProbe()
val machine =
- probe.childActorOf(
+ parentProbe.childActorOf(
ActivationClientProxy
.props(invocationNamespace.asString, fqn, rev, schedulerHost,
rpcPort, containerId, client))
- registerCallback(machine, probe)
- ready(machine, probe)
+
+ // set up watch of client proxy fsm
+ machine ! SubscribeTransitionCallBack(selfProbe.ref)
+ selfProbe.expectMsg(CurrentState(machine, ClientProxyUninitialized))
+ selfProbe watch machine
+
+ // wait for client proxy to be ready
+ machine ! StartClient
+ parentProbe.expectMsg(ClientCreationCompleted)
+ selfProbe.expectMsg(Transition(machine, ClientProxyUninitialized,
ClientProxyReady))
machine ! RequestActivation()
- inAnyOrder {
- probe.expectMsg(Transition(machine, ClientProxyReady,
ClientProxyRemoving))
- probe.expectMsgPF() {
- case Failure(t) => t.getMessage.contains(s"action version does not
match") shouldBe true
- }
+ // next two events can happen in any order
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]