More test improvements (#251)
* add additional time for consumer init and up retry value
* update produce tests to not fail immediately with multiple activations
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 @@
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 @@
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 @@
// 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 @@
// 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