openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From houshen...@apache.org
Subject [incubator-openwhisk-cli] 03/04: Adding retries to '--last' test to account for eventual consistency. (#2509)
Date Fri, 21 Jul 2017 16:33:32 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 4dc045a134c176b5547bdb60390f6a7a31a83f82
Author: Markus Thömmes <markusthoemmes@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 ed926a2..b14d314 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" <commits@openwhisk.apache.org>.

Mime
View raw message