Skip to content

Commit 74002c3

Browse files
dnhatnrjernst
authored andcommitted
Allow configure timeout in REST tests from sys props (elastic#133748)
When debugging REST tests with a remote debugger, we often need to manually increase the client socket timeout in the code. This allows us to spend more time in the debugger without the query failing due to a timeout. This change allows configuring the client socket timeout from a system property. For example: ``` ./gradlew :x-pack:plugin:esql:qa:server:single-node:yamlRestTest --tests "org.elasticsearch.xpack.esql.qa.single_node.EsqlClientYamlIT" -Dtests.client.socket.timeout=10m ```
1 parent 753ad95 commit 74002c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,9 @@ protected Settings restClientSettings() {
16091609
final var projectId = System.getProperty("tests.rest.project.id");
16101610
builder.put(ThreadContext.PREFIX + ".X-Elastic-Project-Id", projectId);
16111611
}
1612+
if (System.getProperty("tests." + CLIENT_SOCKET_TIMEOUT) != null) {
1613+
builder.put(CLIENT_SOCKET_TIMEOUT, System.getProperty("tests." + CLIENT_SOCKET_TIMEOUT));
1614+
}
16121615
return builder.build();
16131616
}
16141617

0 commit comments

Comments
 (0)