From 1bb1c778858f6a371ff00e4c27409dd4e3f269a8 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Sat, 7 Sep 2019 07:40:16 +0200 Subject: [PATCH] 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 --- .../java/org/elasticsearch/test/rest/ESRestTestCase.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java index 4513e5d98f7..22fbc40a52e 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java @@ -834,10 +834,9 @@ public abstract class ESRestTestCase extends ESTestCase { builder.setDefaultHeaders(defaultHeaders); } final String socketTimeoutString = settings.get(CLIENT_SOCKET_TIMEOUT); - if (socketTimeoutString != null) { - final TimeValue socketTimeout = TimeValue.parseTimeValue(socketTimeoutString, CLIENT_SOCKET_TIMEOUT); - builder.setRequestConfigCallback(conf -> conf.setSocketTimeout(Math.toIntExact(socketTimeout.getMillis()))); - } + final TimeValue socketTimeout = + TimeValue.parseTimeValue(socketTimeoutString == null ? "60s" : socketTimeoutString, CLIENT_SOCKET_TIMEOUT); + builder.setRequestConfigCallback(conf -> conf.setSocketTimeout(Math.toIntExact(socketTimeout.getMillis()))); if (settings.hasValue(CLIENT_PATH_PREFIX)) { builder.setPathPrefix(settings.get(CLIENT_PATH_PREFIX)); }