You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ma...@apache.org on 2018/04/26 12:19:09 UTC
[incubator-openwhisk] branch master updated: Increase
RuncClientTests timeout (#3586)
This is an automated email from the ASF dual-hosted git repository.
markusthoemmes 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 d1be01b Increase RuncClientTests timeout (#3586)
d1be01b is described below
commit d1be01bcd1177aaf0c51b6dd71a8071e86b9d382
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Thu Apr 26 17:49:03 2018 +0530
Increase RuncClientTests timeout (#3586)
Switch to using ScalaFutures with IntegrationPatience (default timeout of 15 sec) for this test
---
.../containerpool/docker/test/RuncClientTests.scala | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
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 340b15d..f752079 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)
}
--
To stop receiving notification emails like this one, please contact
markusthoemmes@apache.org.