Skip to content

Instantly share code, notes, and snippets.

@devshorts
Last active October 19, 2016 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devshorts/9f6247a261073deb66ea7b439976a2a9 to your computer and use it in GitHub Desktop.
Save devshorts/9f6247a261073deb66ea7b439976a2a9 to your computer and use it in GitHub Desktop.
@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