You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by du...@apache.org on 2018/02/26 20:38:16 UTC

[incubator-openwhisk-package-kafka] branch master updated: More test improvements (#251)

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


The following commit(s) were added to refs/heads/master by this push:
     new 96fd5af  More test improvements (#251)
96fd5af is described below

commit 96fd5af8fef2b25b281ce652ce6f7b88cdb33f46
Author: Adnan Baruni <ab...@users.noreply.github.com>
AuthorDate: Mon Feb 26 14:38:14 2018 -0600

    More test improvements (#251)
    
    * add additional time for consumer init and up retry value
    
    * update produce tests to not fail immediately with multiple activations
---
 tests/src/test/scala/system/health/BasicHealthTest.scala          | 8 +++++++-
 tests/src/test/scala/system/packages/MessageHubProduceTests.scala | 4 ++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests/src/test/scala/system/health/BasicHealthTest.scala b/tests/src/test/scala/system/health/BasicHealthTest.scala
index 52b176d..02183d2 100644
--- a/tests/src/test/scala/system/health/BasicHealthTest.scala
+++ b/tests/src/test/scala/system/health/BasicHealthTest.scala
@@ -87,8 +87,14 @@ class BasicHealthTest
         activation =>
           // should be successful
           activation.response.success shouldBe true
+
+          // It takes a moment for the consumer to fully initialize.
+          println("Giving the consumer a moment to get ready")
+          Thread.sleep(consumerInitTime)
+
           val uuid = activation.response.result.get.fields.get("uuid").get.toString().replaceAll("\"", "")
 
+          println("Checking health endpoint(s) for existence of consumer uuid")
           // get /health endpoint(s) and ensure it contains the new uuid
           val healthUrls = System.getProperty("health_url").split("\\s*,\\s*").filterNot(_.isEmpty)
           healthUrls shouldNot be(empty)
@@ -111,7 +117,7 @@ class BasicHealthTest
 
             uuids should contain(uuid)
 
-          }, N = 3, waitBeforeRetry = Some(1.second))
+          }, N = 10, waitBeforeRetry = Some(1.second))
       }
   }
 
diff --git a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
index eb4bcd1..3c2aac8 100644
--- a/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
+++ b/tests/src/test/scala/system/packages/MessageHubProduceTests.scala
@@ -200,7 +200,7 @@ class MessageHubProduceTests
             // verify trigger fired
             println("Polling for activations")
             val activations = wsk.activation.pollFor(N = 1, Some(triggerName), retries = maxRetries)
-            assert(activations.length == 1)
+            assert(activations.length > 0)
 
             val matchingActivations = for {
                 id <- activations
@@ -269,7 +269,7 @@ class MessageHubProduceTests
             // verify trigger fired
             println("Polling for activations")
             val activations = wsk.activation.pollFor(N = 1, Some(triggerName), retries = maxRetries)
-            assert(activations.length == 1)
+            assert(activations.length > 0)
 
             val matchingActivations = for {
                 id <- activations

-- 
To stop receiving notification emails like this one, please contact
dubeejw@apache.org.