I test 2 methods of my controller separatedly - test runs without problems. I run them together and get a timeout in the second of them:
[error] TimeoutException: Futures timed out after [10000 milliseconds] (Promise.scala:134)
These methods don't have any dependency between them. I also got same error with other 2 methods.
Here are my current 2 tests:
"a" in {
running(FakeApplication()) {
val Some(result) = route(FakeRequest(GET, "/api/a"))
status(result) must equalTo(OK)
contentType(result) must beSome("application/json")
charset(result) must beSome("utf-8")
}
}
"b" in {
running(FakeApplication()) {
val Some(result) = route(FakeRequest(GET, "/api/b"))
status(result) must equalTo(OK)
contentType(result) must beSome("application/json")
charset(result) must beSome("utf-8")
}
}
What's going on? Maybe FakeApplication of the first test doesn't close properly? I don't see any error in log besides the timeout. I also tried putting a Thread.sleep call after the call (before status-test) in the second test, but this didn't help, not even with 60 seconds.