Last active
October 19, 2016 17:13
-
-
Save devshorts/9f6247a261073deb66ea7b439976a2a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(classOf[JUnitRunner]) | |
class ClientObjectTests extends FlatSpec with Matchers with BeforeAndAfterAll { | |
"A client" should "be closeable" in { | |
val client = | |
ClientBuilder() | |
.dest("localhost:1") | |
.codec(Http()) | |
.hostConnectionLimit(1) | |
.build() | |
val request = client(RequestBuilder.get("invalid")).rescue { | |
case e: Exception => Future.value("this is ok") | |
} | |
println(Await.result(request)) | |
Await.result(client.close()) // heap OOM error... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment