style95 commented on code in PR #5344:
URL: https://github.com/apache/openwhisk/pull/5344#discussion_r1010011304


##########
tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala:
##########
@@ -683,6 +683,54 @@ class SchedulingDecisionMakerTests
     testProbe.expectMsg(DecisionResults(AddContainer, 2))
   }
 
+  it should "add more containers when there are stale messages and non-stale 
messages and both message classes need more containers" in {
+    val decisionMaker = 
system.actorOf(SchedulingDecisionMaker.props(testNamespace, action, 
schedulingConfig))
+    val testProbe = TestProbe()
+
+    val msg = QueueSnapshot(
+      initialized = true,
+      incomingMsgCount = new AtomicInteger(0),
+      currentMsgCount = 5,
+      existingContainerCount = 2,
+      inProgressContainerCount = 0,
+      staleActivationNum = 2,
+      existingContainerCountInNamespace = 2,
+      inProgressContainerCountInNamespace = 0,
+      averageDuration = Some(1000), // the average duration exists
+      limit = 10,
+      stateName = Running,
+      recipient = testProbe.ref)
+
+    decisionMaker ! msg
+
+    //should add two for the stale messages and one to increase tps of 
non-stale available messages
+    testProbe.expectMsg(DecisionResults(AddContainer, 3))
+  }
+
+  it should "add more containers when there are stale messages and non-stale 
messages have needed tps" in {
+    val decisionMaker = 
system.actorOf(SchedulingDecisionMaker.props(testNamespace, action, 
schedulingConfig))
+    val testProbe = TestProbe()
+
+    val msg = QueueSnapshot(
+      initialized = true,
+      incomingMsgCount = new AtomicInteger(0),
+      currentMsgCount = 5,
+      existingContainerCount = 2,
+      inProgressContainerCount = 0,
+      staleActivationNum = 2,
+      existingContainerCountInNamespace = 2,
+      inProgressContainerCountInNamespace = 0,
+      averageDuration = Some(50), // the average duration gives container 
throughput of 2

Review Comment:
   No, I used to calculate the throughput based on 1s. It's not related to the 
systems default.
   



##########
tests/src/test/scala/org/apache/openwhisk/core/scheduler/queue/test/SchedulingDecisionMakerTests.scala:
##########
@@ -683,6 +683,54 @@ class SchedulingDecisionMakerTests
     testProbe.expectMsg(DecisionResults(AddContainer, 2))
   }
 
+  it should "add more containers when there are stale messages and non-stale 
messages and both message classes need more containers" in {
+    val decisionMaker = 
system.actorOf(SchedulingDecisionMaker.props(testNamespace, action, 
schedulingConfig))
+    val testProbe = TestProbe()
+
+    val msg = QueueSnapshot(
+      initialized = true,
+      incomingMsgCount = new AtomicInteger(0),
+      currentMsgCount = 5,
+      existingContainerCount = 2,
+      inProgressContainerCount = 0,
+      staleActivationNum = 2,
+      existingContainerCountInNamespace = 2,
+      inProgressContainerCountInNamespace = 0,
+      averageDuration = Some(1000), // the average duration exists
+      limit = 10,
+      stateName = Running,
+      recipient = testProbe.ref)
+
+    decisionMaker ! msg
+
+    //should add two for the stale messages and one to increase tps of 
non-stale available messages
+    testProbe.expectMsg(DecisionResults(AddContainer, 3))
+  }
+
+  it should "add more containers when there are stale messages and non-stale 
messages have needed tps" in {
+    val decisionMaker = 
system.actorOf(SchedulingDecisionMaker.props(testNamespace, action, 
schedulingConfig))
+    val testProbe = TestProbe()
+
+    val msg = QueueSnapshot(
+      initialized = true,
+      incomingMsgCount = new AtomicInteger(0),
+      currentMsgCount = 5,
+      existingContainerCount = 2,
+      inProgressContainerCount = 0,
+      staleActivationNum = 2,
+      existingContainerCountInNamespace = 2,
+      inProgressContainerCountInNamespace = 0,
+      averageDuration = Some(50), // the average duration gives container 
throughput of 2

Review Comment:
   No, I used to calculate the throughput based on 1s. It's not related to the 
system default.
   



-- 
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]

Reply via email to