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-package-kafka.git


The following commit(s) were added to refs/heads/master by this push:
     new b074137  make number of retries configurable via system property (#231)
b074137 is described below

commit b074137c80f9b15b81446895e7ab2de3522a07c4
Author: Adnan Baruni <abar...@users.noreply.github.com>
AuthorDate: Wed Dec 13 11:10:34 2017 -0600

    make number of retries configurable via system property (#231)
---
 tests/build.gradle                                             |  1 +
 tests/src/test/scala/system/health/BasicHealthTest.scala       |  4 +++-
 tests/src/test/scala/system/packages/MessageHubFeedTests.scala | 10 ++++++----
 .../test/scala/system/packages/MessageHubProduceTests.scala    |  6 ++++--
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/tests/build.gradle b/tests/build.gradle
index fc8cacf..e94c999 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -17,6 +17,7 @@ def commonConfiguration = {
   systemProperty 'host', System.getProperty('host', '')
   systemProperty 'port', System.getProperty('port', '')
   systemProperty 'trigger.suffix', System.getProperty('trigger.suffix', '')
+  systemProperty 'max.retries', System.getProperty('max.retries', '60')
   testLogging {
     events "passed", "skipped", "failed"
     showStandardStreams = true
diff --git a/tests/src/test/scala/system/health/BasicHealthTest.scala 
b/tests/src/test/scala/system/health/BasicHealthTest.scala
index cd66269..b9a6ee5 100644
--- a/tests/src/test/scala/system/health/BasicHealthTest.scala
+++ b/tests/src/test/scala/system/health/BasicHealthTest.scala
@@ -68,6 +68,8 @@ class BasicHealthTest
 
   val kafkaUtils = new KafkaUtils
 
+  val maxRetries = System.getProperty("max.retries").toInt
+
   behavior of "Message Hub feed"
 
   it should "create a new trigger" in withAssetCleaner(wskprops) {
@@ -172,7 +174,7 @@ class BasicHealthTest
         }
 
         println("Polling for activations")
-        val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
since = Some(start), retries = 30)
+        val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
since = Some(start), retries = maxRetries)
         assert(activations.length > 0)
 
         println("Validating content of activation(s)")
diff --git a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala 
b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
index 241ad6b..77a5fc9 100644
--- a/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubFeedTests.scala
@@ -64,6 +64,8 @@ class MessageHubFeedTests
 
   val kafkaUtils = new KafkaUtils
 
+  val maxRetries = System.getProperty("max.retries").toInt
+
   implicit val wskprops = WskProps()
   val wsk = new Wsk()
   val actionName = s"${messagingPackage}/${messageHubFeed}"
@@ -164,7 +166,7 @@ class MessageHubFeedTests
       }
 
       println("Polling for activations")
-      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = 60)
+      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = maxRetries)
       assert(activations.length > 0)
 
       val matchingActivations = for {
@@ -231,7 +233,7 @@ class MessageHubFeedTests
 
       // verify there are two trigger activations required to handle these 
messages
       println("Polling for activations")
-      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = 60)
+      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = maxRetries)
 
       println("Verifying activation content")
       val matchingActivations = for {
@@ -284,7 +286,7 @@ class MessageHubFeedTests
 
       // verify there are no activations that match
       println("Polling for activations")
-      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = 60)
+      val activations = wsk.activation.pollFor(N = 100, Some(triggerName), 
retries = maxRetries)
 
       println("Verifying activation content")
       val matchingActivations = for {
@@ -461,7 +463,7 @@ class MessageHubFeedTests
 
   def checkForActivations(triggerName: String, since: Instant, topic: String, 
key: String, value: String) = {
     println("Polling for activations")
-    val activations = wsk.activation.pollFor(N = 100, Some(triggerName), since 
= Some(since), retries = 30)
+    val activations = wsk.activation.pollFor(N = 100, Some(triggerName), since 
= Some(since), retries = maxRetries)
     assert(activations.length > 0)
 
     println("Validating content of activation(s)")
diff --git a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala 
b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
index c193648..0740038 100644
--- a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
@@ -65,6 +65,8 @@ class MessageHubProduceTests
 
     val kafkaUtils = new KafkaUtils
 
+  val maxRetries = System.getProperty("max.retries").toInt
+
     val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
     val defaultActionName = "hello"
 
@@ -196,7 +198,7 @@ class MessageHubProduceTests
 
             // verify trigger fired
             println("Polling for activations")
-            val activations = wsk.activation.pollFor(N = 100, 
Some(triggerName), retries = 60)
+            val activations = wsk.activation.pollFor(N = 100, 
Some(triggerName), retries = maxRetries)
             assert(activations.length > 0)
 
             val matchingActivations = for {
@@ -263,7 +265,7 @@ class MessageHubProduceTests
 
             // verify trigger fired
             println("Polling for activations")
-            val activations = wsk.activation.pollFor(N = 100, 
Some(triggerName), retries = 60)
+            val activations = wsk.activation.pollFor(N = 100, 
Some(triggerName), retries = maxRetries)
             assert(activations.length > 0)
 
             val matchingActivations = for {

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

Reply via email to