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/26 13:29:20 UTC

[GitHub] sven-lange-last commented on a change in pull request #3326: Make SplunkLogStore tests more resilient.

sven-lange-last commented on a change in pull request #3326: Make SplunkLogStore tests more resilient.
URL: https://github.com/apache/incubator-openwhisk/pull/3326#discussion_r170590247
 
 

 ##########
 File path: tests/src/test/scala/whisk/core/containerpool/logging/SplunkLogStoreTests.scala
 ##########
 @@ -17,59 +17,40 @@
 
 package whisk.core.containerpool.logging
 
+import java.time.ZonedDateTime
+
 import akka.NotUsed
 import akka.actor.ActorSystem
 import akka.http.javadsl.model.headers.Authorization
-import akka.http.scaladsl.model.ContentTypes
-import akka.http.scaladsl.model.FormData
-import akka.http.scaladsl.model.HttpEntity
-import akka.http.scaladsl.model.HttpRequest
-import akka.http.scaladsl.model.HttpResponse
-import akka.http.scaladsl.model.StatusCodes
+import akka.http.scaladsl.model._
 import akka.http.scaladsl.unmarshalling.Unmarshal
-import akka.stream.ActorMaterializer
-import akka.stream.StreamTcpException
+import akka.stream.{ActorMaterializer, StreamTcpException}
 import akka.stream.scaladsl.Flow
 import akka.testkit.TestKit
 import common.StreamLogging
-import java.time.ZonedDateTime
 import org.junit.runner.RunWith
-import org.scalatest.Matchers
-import org.scalatest.concurrent.PatienceConfiguration.Timeout
+import org.scalatest.{FlatSpecLike, Matchers}
 import org.scalatest.concurrent.ScalaFutures
 import org.scalatest.junit.JUnitRunner
-import scala.util.Failure
-import whisk.core.entity.ActivationLogs
-import org.scalatest.FlatSpecLike
 import pureconfig.error.ConfigReaderException
-import scala.concurrent.Await
-import scala.concurrent.Promise
-import scala.concurrent.duration._
-import scala.util.Success
-import scala.util.Try
-import spray.json.JsNumber
-import spray.json.JsObject
-import spray.json._
-import whisk.core.entity.ActionLimits
-import whisk.core.entity.ActivationId
-import whisk.core.entity.ActivationResponse
-import whisk.core.entity.EntityName
-import whisk.core.entity.EntityPath
-import whisk.core.entity.LogLimit
-import whisk.core.entity.MemoryLimit
-import whisk.core.entity.Parameters
-import whisk.core.entity.Subject
-import whisk.core.entity.TimeLimit
-import whisk.core.entity.WhiskActivation
+import spray.json.{JsNumber, JsObject, _}
+import whisk.core.entity._
 import whisk.core.entity.size._
 
+import scala.concurrent.duration._
+import scala.concurrent.{Await, ExecutionContext, Future, Promise}
+import scala.util.{Failure, Success, Try}
+
 @RunWith(classOf[JUnitRunner])
 class SplunkLogStoreTests
     extends TestKit(ActorSystem("SplunkLogStore"))
     with FlatSpecLike
     with Matchers
     with ScalaFutures
     with StreamLogging {
+
+  def await[T](awaitable: Future[T], timeout: FiniteDuration = 10.seconds) = Await.result(awaitable, timeout)
+
   val testConfig = SplunkLogStoreConfig(
     "splunk-host",
 
 Review comment:
   I suggest to specify a bogus IP address instead of a bogus host name. A bogus host name will require DNS name resolution which takes much longer than connecting the bogus IP address directly.
   
   We could use 127.0.0.1 together with a port that will fail when connected - for example, port 7 (echo protocol).

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