You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by cs...@apache.org on 2017/09/11 17:19:57 UTC

[incubator-openwhisk-package-cloudant] branch master updated: update logging level for maxTriggers (#129)

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-cloudant.git


The following commit(s) were added to refs/heads/master by this push:
     new a875392  update logging level for maxTriggers (#129)
a875392 is described below

commit a875392a91d0bb034bd42c2687a262b1882bb5f0
Author: Jason Peterson <ja...@us.ibm.com>
AuthorDate: Mon Sep 11 13:19:55 2017 -0400

    update logging level for maxTriggers (#129)
---
 provider/lib/utils.js                                   |  2 +-
 .../scala/system/health/CloudantHealthFeedTests.scala   | 17 +++++++++++------
 2 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/provider/lib/utils.js b/provider/lib/utils.js
index f7cd444..9e8c2f4 100644
--- a/provider/lib/utils.js
+++ b/provider/lib/utils.js
@@ -193,7 +193,7 @@ module.exports = function(
             logger.info(method, 'Trigger', triggerId, 'was successfully fired');
             if (dataTrigger.triggersLeft === 0) {
                 utils.disableTrigger(dataTrigger.id, undefined, 'Automatically disabled after reaching max triggers');
-                logger.error(method, 'no more triggers left, disabled', dataTrigger.id);
+                logger.warn(method, 'no more triggers left, disabled', dataTrigger.id);
             }
         })
         .catch(err => {
diff --git a/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala b/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
index a5e747e..0a5cb45 100644
--- a/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
+++ b/tests/src/test/scala/system/health/CloudantHealthFeedTests.scala
@@ -16,6 +16,8 @@
  */
 package system.health
 
+import java.time.{Clock, Instant}
+
 import org.junit.runner.RunWith
 import org.scalatest.FlatSpec
 import org.scalatest.junit.JUnitRunner
@@ -66,6 +68,7 @@ class CloudantHealthFeedTests
                 }
 
                 // create whisk stuff
+                println(s"Creating trigger: $triggerName")
                 val feedCreationResult = assetHelper.withCleaner(wsk.trigger, triggerName) {
                     (trigger, name) =>
                         trigger.create(name, feed = Some(s"$packageName/$feed"), parameters = Map(
@@ -76,16 +79,18 @@ class CloudantHealthFeedTests
                 }
                 feedCreationResult.stdout should include("ok")
 
-                // Feed is not actually alive yet - see issue #1954
-                Thread.sleep(5000)
+                val activationsBeforeChange = wsk.activation.pollFor(N = 1, Some(triggerName)).length
+                activationsBeforeChange should be(0)
 
                 // create a test doc in the sample db
-                println("create a test doc and wait for trigger")
                 CloudantUtil.createDocument(myCloudantCreds, "{\"test\":\"test_doc1\"}")
+                val now = Instant.now(Clock.systemUTC())
+                println(s"created a test doc at $now")
 
                 // get activation list of the trigger, expecting exactly 1
                 val activations = wsk.activation.pollFor(N = 1, Some(triggerName), retries = 30).length
-                println(s"Found activation size (should be exactly 1): $activations")
+                val nowPoll = Instant.now(Clock.systemUTC())
+                println(s"Found activation size ($nowPoll): $activations")
                 withClue("Change feed trigger count: ") { activations should be(1) }
 
                 // delete the whisk trigger, which must also delete the feed
@@ -126,7 +131,7 @@ class CloudantHealthFeedTests
                     (pkg, name) => pkg.bind("/whisk.system/cloudant", name)
                 }
 
-                println("Creating cloudant trigger feed.")
+                println(s"Creating trigger: $triggerName")
                 val feedCreationResult = assetHelper.withCleaner(wsk.trigger, triggerName, confirmDelete = false) {
                     (trigger, name) =>
                         trigger.create(name, feed = Some(s"$packageName/$feed"), parameters = Map(
@@ -169,7 +174,7 @@ class CloudantHealthFeedTests
                 (pkg, name) => pkg.bind("/whisk.system/cloudant", name)
                 }
 
-                println("Creating cloudant trigger feed.")
+                println(s"Creating trigger: $triggerName")
                 val feedCreationResult = assetHelper.withCleaner(wsk.trigger, triggerName, confirmDelete = false) {
                 (trigger, name) =>
                     trigger.create(name, feed = Some(s"$packageName/$feed"), parameters = Map(

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