=htt - Improve stability of ClientServerSpec

This commit is contained in:
Viktor Klang 2015-11-01 00:55:55 +01:00
parent 20f54435f1
commit 4c4a7b0c7f

View file

@ -168,12 +168,9 @@ class ClientServerSpec extends WordSpec with Matchers with BeforeAndAfterAll {
val serverReceivedRequestAtNanos = Await.result(receivedRequest.future, 2.seconds) val serverReceivedRequestAtNanos = Await.result(receivedRequest.future, 2.seconds)
// waiting for the timeout to happen on the client // waiting for the timeout to happen on the client
Try(Await.result(clientsResponseFuture, 2.second)).recoverWith { intercept[StreamTcpException] { Await.result(clientsResponseFuture, 2.second) }
case _: StreamTcpException Success(System.nanoTime())
case other: Throwable Failure(other) (System.nanoTime() - serverReceivedRequestAtNanos).millis should be >= theIdleTimeout
}.get
val diff = System.nanoTime() - serverReceivedRequestAtNanos
diff should be > theIdleTimeout.toNanos
} }
"log materialization errors in `bindAndHandle`" which { "log materialization errors in `bindAndHandle`" which {