do not disable trigger on 409 (conflict) (#185)
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 @@
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 @@
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 @@
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)