Skip to content

Commit 1bb1c77

Browse files
Increase REST-Test Client Timeout to 60s (#46455) (#46461)
We are seeing requests take more than the default 30s which leads to requests being retried and returning unexpected failures like e.g. "index already exists" because the initial requests that timed out, worked out functionally anyway. => double the timeout to reduce the likelihood of the failures described in #46091 => As suggested in the issue, we should in a follow-up turn off retrying all-together probably
1 parent a6cc0de commit 1bb1c77

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,9 @@ protected static void configureClient(RestClientBuilder builder, Settings settin
834834
builder.setDefaultHeaders(defaultHeaders);
835835
}
836836
final String socketTimeoutString = settings.get(CLIENT_SOCKET_TIMEOUT);
837-
if (socketTimeoutString != null) {
838-
final TimeValue socketTimeout = TimeValue.parseTimeValue(socketTimeoutString, CLIENT_SOCKET_TIMEOUT);
839-
builder.setRequestConfigCallback(conf -> conf.setSocketTimeout(Math.toIntExact(socketTimeout.getMillis())));
840-
}
837+
final TimeValue socketTimeout =
838+
TimeValue.parseTimeValue(socketTimeoutString == null ? "60s" : socketTimeoutString, CLIENT_SOCKET_TIMEOUT);
839+
builder.setRequestConfigCallback(conf -> conf.setSocketTimeout(Math.toIntExact(socketTimeout.getMillis())));
841840
if (settings.hasValue(CLIENT_PATH_PREFIX)) {
842841
builder.setPathPrefix(settings.get(CLIENT_PATH_PREFIX));
843842
}

0 commit comments

Comments
 (0)