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/03/26 09:03:13 UTC

[GitHub] markusthoemmes commented on a change in pull request #3485: Action time limit test cleanup

markusthoemmes commented on a change in pull request #3485: Action time limit test cleanup
URL: https://github.com/apache/incubator-openwhisk/pull/3485#discussion_r177021536
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/limits/MaxActionDurationTests.scala
 ##########
 @@ -42,38 +43,57 @@ class MaxActionDurationTests extends TestHelpers with WskTestHelpers {
   implicit val wskprops = WskProps()
   val wsk = new WskRest
 
-  // swift is not tested, because it uses the same proxy like python
-  "node-, python, and java-action" should "run up to the max allowed duration" in withAssetCleaner(wskprops) {
-    (wp, assetHelper) =>
-      // When you add more runtimes, keep in mind, how many actions can be processed in parallel by the Invokers!
-      Map("node" -> "helloDeadline.js", "python" -> "timedout.py", "java" -> "timedout.jar").par.map {
-        case (k, name) =>
-          assetHelper.withCleaner(wsk.action, name) {
-            if (k == "java") { (action, _) =>
-              action.create(
-                name,
-                Some(TestUtils.getTestActionFilename(name)),
-                timeout = Some(TimeLimit.MAX_DURATION),
-                main = Some("TimedOut"))
-            } else { (action, _) =>
-              action.create(name, Some(TestUtils.getTestActionFilename(name)), timeout = Some(TimeLimit.MAX_DURATION))
-            }
+  /**
+   * Purpose of the following integration test is to verify that the action proxy
+   * supports the configured maximum action time limit and does not interrupt a
+   * running action before the invoker does.
+   *
+   * Action proxies have to run actions potentially endlessly. It's the invoker's
+   * duty to enforce action time limits.
+   *
+   * Background: in the past, the Node.js action proxy terminated an action
+   * before it actually reached its maximum action time limit.
+   *
+   * Swift is not tested because it uses the same action proxy as Python.
+   *
+   * ATTENTION: this test runs for at least TimeLimit.MAX_DURATION + 1 minute.
+   * With default settings, this is around 6 minutes.
+   */
+  "node-, python, and java-action" should s"run up to the max allowed duration (${TimeLimit.MAX_DURATION})" taggedAs (Slow) in withAssetCleaner(
+    wskprops) { (wp, assetHelper) =>
+    // When you add more runtimes, keep in mind, how many actions can be processed in parallel by the Invokers!
+    Map("node" -> "helloDeadline.js", "python" -> "sleep.py", "java" -> "sleep.jar").par.map {
+      case (k, name) =>
+        println(s"Testing action kind '${k}' with action '${name}'")
+        assetHelper.withCleaner(wsk.action, name) {
+          if (k == "java") { (action, _) =>
+            action.create(
+              name,
+              Some(TestUtils.getTestActionFilename(name)),
+              timeout = Some(TimeLimit.MAX_DURATION),
+              main = Some("Sleep"))
+          } else { (action, _) =>
+            action.create(name, Some(TestUtils.getTestActionFilename(name)), timeout = Some(TimeLimit.MAX_DURATION))
 
 Review comment:
   As the only change per kind is the main parameter, WDYT about this:
   
   ```scala
   assetHelper.withCleaner(wsk.action, name) { (action, _) =>
     val main = if(k == "java") Some("Sleep") else None
     action.create(
       name, 
       Some(TestUtils.getTestActionFilename(name)), 
       timeout = Some(TimeLimit.MAX_DURATION), 
       main = main)
   }
   ```

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