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/26 12:19:05 UTC
[GitHub] markusthoemmes closed pull request #3586: Increase RuncClientTests
timeout
markusthoemmes closed pull request #3586: Increase RuncClientTests timeout
URL: https://github.com/apache/incubator-openwhisk/pull/3586
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/docker/test/RuncClientTests.scala b/tests/src/test/scala/whisk/core/containerpool/docker/test/RuncClientTests.scala
index 340b15d64d..f75207942e 100644
--- a/tests/src/test/scala/whisk/core/containerpool/docker/test/RuncClientTests.scala
+++ b/tests/src/test/scala/whisk/core/containerpool/docker/test/RuncClientTests.scala
@@ -27,26 +27,31 @@ import org.scalatest.junit.JUnitRunner
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
-import scala.concurrent.Await
import org.scalatest.Matchers
import whisk.core.containerpool.docker.RuncClient
import common.{StreamLogging, WskActorSystem}
import whisk.core.containerpool.ContainerId
import whisk.common.TransactionId
import org.scalatest.BeforeAndAfterEach
+import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures}
import whisk.common.LogMarker
import whisk.common.LoggingMarkers.INVOKER_RUNC_CMD
@RunWith(classOf[JUnitRunner])
-class RuncClientTests extends FlatSpec with Matchers with StreamLogging with BeforeAndAfterEach with WskActorSystem {
+class RuncClientTests
+ extends FlatSpec
+ with Matchers
+ with StreamLogging
+ with BeforeAndAfterEach
+ with WskActorSystem
+ with ScalaFutures
+ with IntegrationPatience {
override def beforeEach = stream.reset()
implicit val transid = TransactionId.testing
val id = ContainerId("Id")
- def await[A](f: Future[A], timeout: FiniteDuration = 500.milliseconds) = Await.result(f, timeout)
-
val runcCommand = "docker-runc"
/** Returns a RuncClient with a mocked result for 'executeProcess' */
@@ -83,13 +88,13 @@ class RuncClientTests extends FlatSpec with Matchers with StreamLogging with Bef
Seq("pause", "resume").foreach { cmd =>
it should s"$cmd a container successfully and create log entries" in {
val rc = runcClient { Future.successful("") }
- await(runcProxy(rc, cmd))
+ runcProxy(rc, cmd).futureValue
verifyLogs(cmd)
}
it should s"write error markers when $cmd fails" in {
val rc = runcClient { Future.failed(new RuntimeException()) }
- a[RuntimeException] should be thrownBy await(runcProxy(rc, cmd))
+ a[RuntimeException] should be thrownBy runcProxy(rc, cmd).futureValue
verifyLogs(cmd, failed = true)
}
----------------------------------------------------------------
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