You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/09/12 08:56:45 UTC
[GitHub] markusthoemmes commented on a change in pull request #4017: Fix
bugs in invoker ids and health protocol bookkeeping
markusthoemmes commented on a change in pull request #4017: Fix bugs in invoker ids and health protocol bookkeeping
URL: https://github.com/apache/incubator-openwhisk/pull/4017#discussion_r216946814
##########
File path: tests/src/test/scala/whisk/core/loadBalancer/test/InvokerSupervisionTests.scala
##########
@@ -310,4 +310,58 @@ class InvokerSupervisionTests
invoker.isTimerActive(InvokerActor.timerName) shouldBe false
}
+
+ it should "initially store invoker status with its full id - instance/uniqueName/displayedName" in {
+
+ val invoker0 = TestProbe()
+ val children = mutable.Queue(invoker0.ref)
+ val childFactory = (f: ActorRefFactory, instance: InvokerInstanceId) => children.dequeue()
+
+ val sendActivationToInvoker = stubFunction[ActivationMessage, InvokerInstanceId, Future[RecordMetadata]]
+ val supervisor = system.actorOf(InvokerPool.props(childFactory, sendActivationToInvoker, pC))
+
+ val invokerInstance = InvokerInstanceId(0, Some("10.x.x.x"), Some("invoker-xyz"))
+
+ within(timeout.duration) {
+
+ val ping = PingMessage(invokerInstance)
+
+ supervisor ! ping
+
+ invoker0.expectMsgType[SubscribeTransitionCallBack]
+ invoker0.expectMsg(ping)
+
+ allStates(supervisor) shouldBe IndexedSeq(new InvokerHealth(invokerInstance, Offline))
+ }
+ }
+ it should "update the invoker instance id after it was restarted" in {
+ val invoker0 = TestProbe()
+ val invoker01 = TestProbe()
+ val children = mutable.Queue(invoker0.ref, invoker01.ref)
+ val childFactory = (f: ActorRefFactory, instance: InvokerInstanceId) => children.dequeue()
+
+ val sendActivationToInvoker = stubFunction[ActivationMessage, InvokerInstanceId, Future[RecordMetadata]]
+ val supervisor = system.actorOf(InvokerPool.props(childFactory, sendActivationToInvoker, pC))
+
+ val invokerInstance = InvokerInstanceId(0, Some("10.x.x.x"), Some("invoker-xyz"))
+
+ val invokerAfterRestart = InvokerInstanceId(0, Some("10.x.x.x"), Some("invoker-zyx"))
+
+ within(timeout.duration) {
+ val ping = PingMessage(invokerInstance)
+
+ supervisor ! ping
+
+ invoker0.expectMsgType[SubscribeTransitionCallBack]
+ invoker0.expectMsg(ping)
+
Review comment:
We should assert that the old instanceId is present here I think.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services