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/04/25 15:19:32 UTC
[GitHub] dubee closed pull request #3578: Widen match on specific exception
in LogStore tests.
dubee closed pull request #3578: Widen match on specific exception in LogStore tests.
URL: https://github.com/apache/incubator-openwhisk/pull/3578
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/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala b/tests/src/test/scala/whisk/core/containerpool/logging/ElasticSearchLogStoreTests.scala
index 13ca7dc7a4..ebd8c8c2c9 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 86541ca50a..d77f6109dc 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 {
----------------------------------------------------------------
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