You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/28 01:37:33 UTC

[GitHub] csantanapr closed pull request #259: Update CURL Tests

csantanapr closed pull request #259: Update CURL Tests
URL: https://github.com/apache/incubator-openwhisk-catalog/pull/259
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/src/test/scala/packages/samples/CurlTest.scala b/tests/src/test/scala/packages/samples/CurlTest.scala
index eeb52f1..92b64ac 100644
--- a/tests/src/test/scala/packages/samples/CurlTest.scala
+++ b/tests/src/test/scala/packages/samples/CurlTest.scala
@@ -21,9 +21,12 @@ import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
 
 import common.{ TestHelpers, Wsk, WskProps, WskTestHelpers }
+
 import spray.json._
 import spray.json.DefaultJsonProtocol._
 
+import whisk.utils.retry
+
 @RunWith(classOf[JUnitRunner])
 class CurlTest extends TestHelpers with WskTestHelpers {
     implicit val wskprops = WskProps()
@@ -34,17 +37,27 @@ class CurlTest extends TestHelpers with WskTestHelpers {
 
     it should "Return Could not resolve host when sending no parameter" in {
         val expectedError = "Could not resolve host"
-        val run = wsk.action.invoke(greetingAction, Map())
-        withActivation(wsk.activation, run) {
-            _.response.result.get.toString should include(expectedError)
-        }
+
+        retry(
+            {
+                val run = wsk.action.invoke(greetingAction, Map())
+                withActivation(wsk.activation, run) {
+                    _.response.result.get.toString should include(expectedError)
+                }
+            })
     }
 
     it should "Return the web content when sending the public google as the payload" in {
         val expectedBody = "<HTML>"
-        val run = wsk.action.invoke(greetingAction, Map("payload" -> "google.com".toJson))
-        withActivation(wsk.activation, run) {
-            _.response.result.get.toString should include(expectedBody)
-        }
+        val host = "google.com"
+
+        retry(
+            {
+                val run = wsk.action.invoke(greetingAction, Map("payload" -> host.toJson))
+                withActivation(wsk.activation, run) {
+                    _.response.result.get.toString should include(expectedBody)
+                }
+            }
+        )
     }
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services