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 2019/06/11 03:26:59 UTC

[incubator-openwhisk] branch master updated: Settle throttle before running the API GW Tests (#4496)

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


The following commit(s) were added to refs/heads/master by this push:
     new da61ad2  Settle throttle before running the API GW Tests (#4496)
da61ad2 is described below

commit da61ad2593ee9473bef906cd1aa004efdb853861
Author: Martin Henke <ma...@de.ibm.com>
AuthorDate: Tue Jun 11 05:26:44 2019 +0200

    Settle throttle before running the API GW Tests (#4496)
    
    * simplify throttle code
    
    * revert to original throttle algorithm
    
    * Make the waiting time to calm down the thottle explicit
---
 tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala      | 5 +----
 .../scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala    | 5 +++++
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
index 186e561..7f7c23e 100644
--- a/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
+++ b/tests/src/test/scala/apigw/healthtests/ApiGwEndToEndTests.scala
@@ -22,21 +22,18 @@ import java.io.File
 import java.io.FileWriter
 
 import scala.concurrent.duration.DurationInt
-
 import org.junit.runner.RunWith
 import org.scalatest.BeforeAndAfterAll
 import org.scalatest.FlatSpec
 import org.scalatest.Matchers
 import org.scalatest.junit.JUnitRunner
-
-import io.restassured.RestAssured
-
 import common.TestHelpers
 import common.TestUtils
 import common.TestUtils._
 import common.WskOperations
 import common.WskProps
 import common.WskTestHelpers
+import io.restassured.RestAssured
 import spray.json._
 import spray.json.DefaultJsonProtocol._
 import system.rest.RestUtil
diff --git a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala
index 1a74f01..dc30f1b 100644
--- a/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala
+++ b/tests/src/test/scala/org/apache/openwhisk/core/cli/test/BaseApiGwTests.scala
@@ -89,6 +89,11 @@ abstract class BaseApiGwTests extends TestHelpers with WskTestHelpers with Befor
    * Create a CLI properties file for use by the tests
    */
   override def beforeAll() = {
+    //Wait a while to settle the throttle so that the status of throttle algorithm implemented in checkThrottle
+    //is consistent with the reality
+    //Without this waiting time API Tests do fail very consistently on faster build machines
+    //In the longer run the APIGW tests should be moved to a separate namespace
+    Thread.sleep(60.seconds.toMillis)
     cliWskPropsFile.deleteOnExit()
     val wskprops = WskProps(token = "SOME TOKEN")
     wskprops.writeFile(cliWskPropsFile)