You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/12/13 17:10:38 UTC

[GitHub] csantanapr closed pull request #231: make number of retries configurable via system property

csantanapr closed pull request #231: make number of retries configurable via system property
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/231
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services