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 a3e2e28  Widen match on specific exception in LogStore tests. (#3578)
a3e2e28 is described below

commit a3e2e2829a1086f795cea4868a63161833e94e9a
Author: Markus Thömmes <[email protected]>
AuthorDate: Wed Apr 25 17:19:30 2018 +0200

    Widen match on specific exception in LogStore tests. (#3578)
    
    We don't particularly care which exception is returned specifically and in 
this case this seems to be a possible race. Just asserting that it fails should 
be well enough in this case.
---
 .../containerpool/logging/ElasticSearchLogStoreTests.scala  | 13 ++++---------
 .../core/containerpool/logging/SplunkLogStoreTests.scala    |  8 ++++----
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git 
a/tests/src/test/scala/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala
 
b/tests/src/test/scala/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala
index 13ca7dc..ebd8c8c 100644
--- 
a/tests/src/test/scala/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala
+++ 
b/tests/src/test/scala/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala
@@ -21,24 +21,19 @@ import java.time.ZonedDateTime
 
 import akka.NotUsed
 import akka.actor.ActorSystem
-import akka.http.scaladsl.model._
 import akka.http.scaladsl.model.HttpMethods.{GET, POST}
+import akka.http.scaladsl.model._
 import akka.http.scaladsl.model.headers.{Accept, RawHeader}
+import akka.stream.ActorMaterializer
 import akka.stream.scaladsl.Flow
-import akka.stream.{ActorMaterializer, StreamTcpException}
 import akka.testkit.TestKit
-
 import common.StreamLogging
-
 import org.junit.runner.RunWith
-import org.scalatest.{FlatSpecLike, Matchers}
 import org.scalatest.concurrent.ScalaFutures
 import org.scalatest.junit.JUnitRunner
-
+import org.scalatest.{FlatSpecLike, Matchers}
 import pureconfig.error.ConfigReaderException
-
 import spray.json._
-
 import whisk.core.entity._
 import whisk.core.entity.size._
 
@@ -185,7 +180,7 @@ class ElasticSearchLogStoreTests
   it should "fail to connect to invalid host" in {
     val esLogStore = new ElasticSearchLogStore(system, elasticSearchConfig = 
defaultConfig)
 
-    a[StreamTcpException] should be thrownBy await(esLogStore.fetchLogs(user, 
activation, defaultLogStoreHttpRequest))
+    a[Throwable] should be thrownBy await(esLogStore.fetchLogs(user, 
activation, defaultLogStoreHttpRequest))
   }
 
   it should "forward errors from ElasticSearch" in {
diff --git 
a/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala
 
b/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala
index 86541ca..d77f610 100644
--- 
a/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala
+++ 
b/tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala
@@ -26,16 +26,16 @@ import akka.http.scaladsl.model.HttpMethods.POST
 import akka.http.scaladsl.model._
 import akka.http.scaladsl.model.headers.RawHeader
 import akka.http.scaladsl.unmarshalling.Unmarshal
+import akka.stream.ActorMaterializer
 import akka.stream.scaladsl.Flow
-import akka.stream.{ActorMaterializer, StreamTcpException}
 import akka.testkit.TestKit
 import common.StreamLogging
 import org.junit.runner.RunWith
-import org.scalatest.{FlatSpecLike, Matchers}
 import org.scalatest.concurrent.ScalaFutures
 import org.scalatest.junit.JUnitRunner
+import org.scalatest.{FlatSpecLike, Matchers}
 import pureconfig.error.ConfigReaderException
-import spray.json.{JsNumber, JsObject, _}
+import spray.json._
 import whisk.core.entity._
 import whisk.core.entity.size._
 
@@ -149,7 +149,7 @@ class SplunkLogStoreTests
   it should "fail to connect to bogus host" in {
     //use the default http flow with the default bogus-host config
     val splunkStore = new SplunkLogStore(system, splunkConfig = testConfig)
-    a[StreamTcpException] should be thrownBy await(splunkStore.fetchLogs(user, 
activation, request))
+    a[Throwable] should be thrownBy await(splunkStore.fetchLogs(user, 
activation, request))
   }
 
   it should "display an error if API cannot be reached" in {

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to