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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3e0a90b  do not disable trigger on 409 (conflict) (#185)
3e0a90b is described below

commit 3e0a90be16be5fc9e17928d3d70e230bfe4771b3
Author: Jason Peterson <jason...@us.ibm.com>
AuthorDate: Mon Nov 26 11:46:25 2018 -0500

    do not disable trigger on 409 (conflict) (#185)
---
 provider/lib/utils.js                                        | 2 +-
 tests/src/test/scala/system/packages/CloudantFeedTests.scala | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/provider/lib/utils.js b/provider/lib/utils.js
index aa12c6d..4bf8e32 100644
--- a/provider/lib/utils.js
+++ b/provider/lib/utils.js
@@ -126,7 +126,7 @@ module.exports = function(logger, triggerDB, redisClient) {
 
     function shouldDisableTrigger(statusCode) {
         return ((statusCode >= 400 && statusCode < 500) &&
-            [HttpStatus.REQUEST_TIMEOUT, 
HttpStatus.TOO_MANY_REQUESTS].indexOf(statusCode) === -1);
+            [HttpStatus.REQUEST_TIMEOUT, HttpStatus.TOO_MANY_REQUESTS, 
HttpStatus.CONFLICT].indexOf(statusCode) === -1);
     }
 
     function shouldFireTrigger(trigger) {
diff --git a/tests/src/test/scala/system/packages/CloudantFeedTests.scala 
b/tests/src/test/scala/system/packages/CloudantFeedTests.scala
index 7e70d8c..49e14dd 100644
--- a/tests/src/test/scala/system/packages/CloudantFeedTests.scala
+++ b/tests/src/test/scala/system/packages/CloudantFeedTests.scala
@@ -40,6 +40,7 @@ class CloudantFeedTests
     val wsk = new Wsk
     val myCloudantCreds = 
CloudantUtil.Credential.makeFromVCAPFile("cloudantNoSQLDB", 
this.getClass.getSimpleName)
     val defaultAction = Some(TestUtils.getTestActionFilename("hello.js"))
+    val maxRetries = System.getProperty("max.retries", "60").toInt
 
     behavior of "Cloudant trigger service"
 
@@ -248,7 +249,7 @@ class CloudantFeedTests
                 response1.get("ok").getAsString should be("true")
 
                 println("Checking for activations")
-                val activations = wsk.activation.pollFor(N = 1, 
Some(triggerName), retries = 30).length
+                val activations = wsk.activation.pollFor(N = 1, 
Some(triggerName), retries = maxRetries).length
                 println(s"Found activation size (should be exactly 1): 
$activations")
                 activations should be(1)
 

Reply via email to