diff options
author | Ivan Topolnak <itopolnak@despegar.com> | 2014-05-20 18:17:23 -0300 |
---|---|---|
committer | Ivan Topolnak <itopolnak@despegar.com> | 2014-05-20 18:26:25 -0300 |
commit | 51ab59c057b17fcdf440d70d6daf06e672e4050f (patch) | |
tree | 6b68b205de3c7dcb002bfbbddcf6c1a1023b3a37 /kamon-spray/src/test/scala/kamon/spray | |
parent | bb5da348cd27ccfa6561f4d6f63c6424e03004fe (diff) | |
download | Kamon-51ab59c057b17fcdf440d70d6daf06e672e4050f.tar.gz Kamon-51ab59c057b17fcdf440d70d6daf06e672e4050f.tar.bz2 Kamon-51ab59c057b17fcdf440d70d6daf06e672e4050f.zip |
= spray: give more time to bind the ports when using the test server
Diffstat (limited to 'kamon-spray/src/test/scala/kamon/spray')
-rw-r--r-- | kamon-spray/src/test/scala/kamon/spray/TestServer.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kamon-spray/src/test/scala/kamon/spray/TestServer.scala b/kamon-spray/src/test/scala/kamon/spray/TestServer.scala index e2d012ab..b448eb02 100644 --- a/kamon-spray/src/test/scala/kamon/spray/TestServer.scala +++ b/kamon-spray/src/test/scala/kamon/spray/TestServer.scala @@ -21,6 +21,7 @@ import spray.can.Http import akka.actor.ActorRef import akka.io.IO import akka.io.Tcp.Bound +import scala.concurrent.duration._ trait TestServer { self: TestKitBase ⇒ @@ -28,7 +29,9 @@ trait TestServer { def buildClientConnectionAndServer: (ActorRef, TestProbe) = { val serverHandler = TestProbe() IO(Http).tell(Http.Bind(listener = serverHandler.ref, interface = "127.0.0.1", port = 0), serverHandler.ref) - val bound = serverHandler.expectMsgType[Bound] + val bound = within(10 seconds) { + serverHandler.expectMsgType[Bound] + } val client = clientConnection(bound) serverHandler.expectMsgType[Http.Connected] |