rabbah commented on a change in pull request #4186: Track activation counts in
ContainerPool (not ContainerProxy)
URL:
https://github.com/apache/incubator-openwhisk/pull/4186#discussion_r252324735
##########
File path:
tests/src/test/scala/org/apache/openwhisk/core/containerpool/test/ContainerPoolTests.scala
##########
@@ -588,6 +685,73 @@ class ContainerPoolObjectTests extends FlatSpec with
Matchers with MockFactory {
}
+ it should "use a warming when active activation count < maxconcurrent" in {
+ val concurrencyEnabled =
Option(WhiskProperties.getProperty("whisk.action.concurrency")).exists(_.toBoolean)
+ val maxConcurrent = if (concurrencyEnabled) 25 else 1
+
+ val action = createAction(limits = ActionLimits(concurrency =
ConcurrencyLimit(maxConcurrent)))
+ val data = warmingData(active = maxConcurrent - 1, action = action)
+ val pool = Map('warming -> data)
+ ContainerPool.schedule(data.action, data.invocationNamespace, pool)
shouldBe Some('warming, data)
+
+ val data2 = warmedData(active = maxConcurrent - 1, action = action)
+ val pool2 = pool ++ Map('warm -> data2)
+
+ ContainerPool.schedule(data2.action, data2.invocationNamespace, pool2)
shouldBe Some('warm, data2)
+
Review comment:
white space.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services