Search code examples
exceptiontimeoutplayframeworkhttprequestfunctional-testing

WSRequest in FunctionalTest would end up timeout


I have the following functional test. For some reason, the get() call always end up getting a java.util.concurrent.TimeoutException: No response received after 60000ms.

Any insights? Also, I tried the same url from inside browser, it works just fine.

public class MyTest extends FunctionalTest {
    @Before
    public void setup() {
        Fixtures.loadYaml("data.yml");
    }

    @Test
    public void testIndex() {
        HttpResponse response = WS.url("http://localhost:9001/tags/index").get(); 
        assertEquals(response.getStatus(), (Integer)200);
    }
}

Solution

  • Adding the following into application.conf would fix the problem

    %test.play.pool=2