mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
Watcher: Fix timeout tests by increasing wait timeout
The request timeout and the real time the webserver slept was 5000ms. In case of loaded systems, there might be cases, where the request was still received in time. This commit increases the server side sleep time to 10 seconds, to ensure that the client aborts the request early Original commit: elastic/x-pack-elasticsearch@718c05519f
This commit is contained in:
parent
2daef601d4
commit
4eef709d2e
@ -93,7 +93,7 @@ public class HttpReadTimeoutTests extends ESTestCase {
|
||||
long start = System.nanoTime();
|
||||
try {
|
||||
httpClient.execute(request);
|
||||
fail("expected read timeout after 5 seconds (default)");
|
||||
fail("expected read timeout after 3 seconds (default)");
|
||||
} catch (ElasticsearchTimeoutException ete) {
|
||||
// expected
|
||||
|
||||
@ -105,7 +105,7 @@ public class HttpReadTimeoutTests extends ESTestCase {
|
||||
assertThat(timeout.seconds(), lessThan(5L));
|
||||
}
|
||||
|
||||
if (!latch.await(10, TimeUnit.SECONDS)) {
|
||||
if (!latch.await(7, TimeUnit.SECONDS)) {
|
||||
// should never happen
|
||||
fail("waited too long for the response to be returned");
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class HttpReadTimeoutTests extends ESTestCase {
|
||||
long start = System.nanoTime();
|
||||
try {
|
||||
httpClient.execute(request);
|
||||
fail("expected read timeout after 5 seconds (default)");
|
||||
fail("expected read timeout after 5 seconds");
|
||||
} catch (ElasticsearchTimeoutException ete) {
|
||||
// expected
|
||||
|
||||
@ -163,7 +163,7 @@ public class HttpReadTimeoutTests extends ESTestCase {
|
||||
@Override
|
||||
public MockResponse dispatch(RecordedRequest request) throws InterruptedException {
|
||||
if (path.equals(request.getPath())) {
|
||||
Thread.sleep(5000);
|
||||
Thread.sleep(10000);
|
||||
latch.countDown();
|
||||
}
|
||||
return new MockResponse().setStatus("200");
|
||||
|
Loading…
x
Reference in New Issue
Block a user