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/19 16:22:26 UTC

[incubator-openwhisk] branch master updated: Adding retries to '--last' test to account for eventual consistency. (#2509)

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 4ece919  Adding retries to '--last' test to account for eventual consistency. (#2509)
4ece919 is described below

commit 4ece919e5a56b172768be5e89d46ac87d0cc68ce
Author: Markus Thömmes <ma...@me.com>
AuthorDate: Wed Jul 19 18:22:24 2017 +0200

    Adding retries to '--last' test to account for eventual consistency. (#2509)
    
    View based queries are subject to eventual consistency. In case the test is running against an environment with a clustered database it is subject to random failures.
---
 tests/src/test/scala/system/basic/WskBasicTests.scala | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/tests/src/test/scala/system/basic/WskBasicTests.scala b/tests/src/test/scala/system/basic/WskBasicTests.scala
index b4d1e09..8e22088 100644
--- a/tests/src/test/scala/system/basic/WskBasicTests.scala
+++ b/tests/src/test/scala/system/basic/WskBasicTests.scala
@@ -35,6 +35,7 @@ import common.WskTestHelpers
 import spray.json._
 import spray.json.DefaultJsonProtocol._
 import spray.json.pimpAny
+import whisk.utils.retry
 
 @RunWith(classOf[JUnitRunner])
 class WskBasicTests
@@ -872,11 +873,13 @@ class WskBasicTests
                         (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)
-                    }
+                    retry({
+                        lastFlag foreach {
+                            case (cmd, output) =>
+                                val stdout = wsk.cli(cmd ++ wskprops.overrides ++ auth, expectedExitCode = SUCCESS_EXIT).stdout
+                                stdout should include(output)
+                        }
+                    }, waitBeforeRetry = Some(500.milliseconds))
             }
     }
 

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