You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/06/26 15:59:42 UTC

[incubator-openwhisk-cli] 02/36: Return Non-zero Exit Code when Action Exceeds Time Limit

This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git

commit 0d81c00c0c2291ee24cccb975298680a25e33051
Author: dubeejw <jw...@us.ibm.com>
AuthorDate: Fri Feb 10 14:52:55 2017 -0500

    Return Non-zero Exit Code when Action Exceeds Time Limit
---
 tests/src/test/scala/system/basic/WskBasicTests.scala    | 8 ++++----
 tests/src/test/scala/system/basic/WskSequenceTests.scala | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index f9e2fb9..82ddffa 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -358,7 +358,7 @@ class WskBasicTests
             }
 
             val stderr = wsk.action.invoke(name, blocking = true, expectedExitCode = 246).stderr
-            CliActivation.serdes.read(stderr.parseJson).response.result shouldBe Some {
+            CliActivation.serdes.read(removeCLIHeader(stderr).parseJson).response.result shouldBe Some {
                 JsObject("error" -> JsObject("msg" -> "failed activation on purpose".toJson))
             }
     }
@@ -422,7 +422,7 @@ class WskBasicTests
             res.stdout shouldBe ("{}\n")
     }
 
-    it should "create, and invoke an action that times out to ensure the result is empty" in withAssetCleaner(wskprops) {
+    it should "create, and invoke an action that times out to ensure the proper response is received" in withAssetCleaner(wskprops) {
         (wp, assetHelper) =>
             val name = "sleepAction"
             val params = Map("payload" -> "100000".toJson)
@@ -431,10 +431,10 @@ class WskBasicTests
                 (action, _) =>
                     action.create(name, Some(TestUtils.getTestActionFilename("timeout.js")),
                         timeout = Some(allowedActionDuration))
-                    action.invoke(name, parameters = params, blocking = true, result = true)
+                    action.invoke(name, parameters = params, blocking = true, result = true, expectedExitCode = ACCEPTED)
             }
 
-            res.stdout should include regex (s"""\\{\\s+"activationId":\\s+"[a-z0-9]{32}"\\s+\\}""")
+            res.stderr should include ("""but the request has not yet finished""")
     }
 
     it should "create, and get docker action get ensure exec code is omitted" in withAssetCleaner(wskprops) {
diff --git a/tests/src/test/scala/system/basic/WskSequenceTests.scala b/tests/src/test/scala/system/basic/WskSequenceTests.scala
index dd41108..4a8b037 100644
--- a/tests/src/test/scala/system/basic/WskSequenceTests.scala
+++ b/tests/src/test/scala/system/basic/WskSequenceTests.scala
@@ -397,7 +397,7 @@ class WskSequenceTests
             }
             // run sequence s with sleep equal to payload
             val payload = 65000
-            val run = wsk.action.invoke(sName, parameters = Map("payload" -> JsNumber(payload)), blocking = true)
+            val run = wsk.action.invoke(sName, parameters = Map("payload" -> JsNumber(payload)), blocking = true, expectedExitCode = ACCEPTED)
             withActivation(wsk.activation, run, initialWait = 5 seconds, totalWait = 3 * allowedActionDuration) {
                 activation =>
                     checkSequenceLogsAndAnnotations(activation, 2) // 2 actions

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.