Avoid that tests wait indefinitely.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2021-01-06 11:34:30 +01:00
parent 343e7b2b2a
commit 5a28c7484a
1 changed files with 3 additions and 0 deletions

View File

@ -60,12 +60,14 @@ public class ValidatingConnectionPoolTest extends AbstractHttpClientServerTest
ContentResponse response = client.newRequest("localhost", connector.getLocalPort()) ContentResponse response = client.newRequest("localhost", connector.getLocalPort())
.scheme(scenario.getScheme()) .scheme(scenario.getScheme())
.timeout(5, TimeUnit.SECONDS)
.send(); .send();
assertEquals(200, response.getStatus()); assertEquals(200, response.getStatus());
// The second request should be sent after the validating timeout. // The second request should be sent after the validating timeout.
response = client.newRequest("localhost", connector.getLocalPort()) response = client.newRequest("localhost", connector.getLocalPort())
.scheme(scenario.getScheme()) .scheme(scenario.getScheme())
.timeout(5, TimeUnit.SECONDS)
.send(); .send();
assertEquals(200, response.getStatus()); assertEquals(200, response.getStatus());
} }
@ -100,6 +102,7 @@ public class ValidatingConnectionPoolTest extends AbstractHttpClientServerTest
ContentResponse response = client.newRequest("localhost", connector.getLocalPort()) ContentResponse response = client.newRequest("localhost", connector.getLocalPort())
.scheme(scenario.getScheme()) .scheme(scenario.getScheme())
.path("/redirect") .path("/redirect")
.timeout(5, TimeUnit.SECONDS)
.send(); .send();
assertEquals(200, response.getStatus()); assertEquals(200, response.getStatus());
} }