You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2017/07/16 12:36:29 UTC

[incubator-openwhisk] branch master updated: Harden system tests for --last flag. (#2497)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new f4cb204  Harden system tests for --last flag. (#2497)
f4cb204 is described below

commit f4cb204a0f7110af4046b3951c2a027e0c407482
Author: Markus Thömmes <ma...@me.com>
AuthorDate: Sun Jul 16 14:36:26 2017 +0200

    Harden system tests for --last flag. (#2497)
    
    Using a hardcoded Thread.sleep timeout will inevitably fail in different test environments. Using the test helpers that retry under the hood will make those tests less intermittent failure prone.
    
    The rejection test doesn't actually need to invoke an action.
---
 .../test/scala/system/basic/WskBasicTests.scala    | 30 ++++++++++------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index f902eee..b4d1e09 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -864,19 +864,19 @@ class WskBasicTests
                 (action, _) => wsk.action.create("lastName", defaultAction)
             }
             val lastInvoke = wsk.action.invoke("lastName")
-            val includeID = wsk.activation.extractActivationId(lastInvoke).get
-            Thread.sleep(1000)
-
-            val lastFlag = Seq(
-                (Seq("activation", "get", "publish", "--last"), includeID),
-                (Seq("activation", "get", "--last"), includeID),
-                (Seq("activation", "logs", "--last"), includeStr),
-                (Seq("activation", "result", "--last"), includeStr))
+            withActivation(wsk.activation, lastInvoke) {
+                activation =>
+                    val lastFlag = Seq(
+                        (Seq("activation", "get", "publish", "--last"), activation.activationId),
+                        (Seq("activation", "get", "--last"), activation.activationId),
+                        (Seq("activation", "logs", "--last"), includeStr),
+                        (Seq("activation", "result", "--last"), includeStr))
 
-            lastFlag foreach {
-                case (cmd, output) =>
-                    val stdout = wsk.cli(cmd ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
-                    stdout should include(output)
+                    lastFlag foreach {
+                        case (cmd, output) =>
+                            val stdout = wsk.cli(cmd ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
+                            stdout should include(output)
+                    }
             }
     }
 
@@ -884,13 +884,9 @@ class WskBasicTests
         (wp, assetHelper) =>
             val auth: Seq[String] = Seq("--auth", wskprops.authKey)
 
-            assetHelper.withCleaner(wsk.action, "lastName") {
-                (action, _) => wsk.action.create("lastName", defaultAction)
-            }
-            val lastId = wsk.activation.extractActivationId(wsk.action.invoke("lastName")).get
+            val lastId = "dummyActivationId"
             val tooManyArgsMsg = s"${lastId}. An activation ID is required."
             val invalidField = s"Invalid field filter '${lastId}'."
-            Thread.sleep(1000)
 
             val invalidCmd = Seq(
                 (Seq("activation", "get", s"$lastId", "publish", "--last"), tooManyArgsMsg),

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