markusthoemmes closed pull request #4025: Add test to verify, that action with 
high memory usage can be invoked.
URL: https://github.com/apache/incubator-openwhisk/pull/4025
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala 
b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
index f2a759bfd9..78fe0ba273 100644
--- a/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
+++ b/tests/src/test/scala/whisk/core/limits/ActionLimitsTests.scala
@@ -399,6 +399,22 @@ class ActionLimitsTests extends TestHelpers with 
WskTestHelpers with WskActorSys
     }
   }
 
+  it should "be able to run a memory intensive actions" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
+    val name = "TestNodeJsInvokeHighMemory"
+    val allowedMemory = MemoryLimit.maxMemory
+    assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {
+      val actionName = TestUtils.getTestActionFilename("memoryWithGC.js")
+      (action, _) =>
+        action.create(name, Some(actionName), memory = Some(allowedMemory))
+    }
+    // Don't try to allocate all the memory on invoking the action, as the 
maximum memory is set for the whole container
+    // and not only for the user action.
+    val run = wsk.action.invoke(name, Map("payload" -> (allowedMemory.toMB - 
56).toJson))
+    withActivation(wsk.activation, run) { response =>
+      response.response.status shouldBe "success"
+    }
+  }
+
   it should "be aborted when exceeding its memory limits" in 
withAssetCleaner(wskprops) { (wp, assetHelper) =>
     val name = "TestNodeJsMemoryExceeding"
     assetHelper.withCleaner(wsk.action, name, confirmDelete = true) {


 

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

Reply via email to