Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix request timeout in HeapAttack tests #104336

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private Response query(String query, String filterPath) throws IOException {
request.setJsonEntity(query.toString().replace("\n", "\\n"));
request.setOptions(
RequestOptions.DEFAULT.toBuilder()
.setRequestConfig(RequestConfig.custom().setSocketTimeout(Math.toIntExact(TimeValue.timeValueMinutes(5).millis())).build())
.setRequestConfig(RequestConfig.custom().setSocketTimeout(Math.toIntExact(TimeValue.timeValueMinutes(6).millis())).build())
.setWarningsHandler(WarningsHandler.PERMISSIVE)
);
logger.info("--> test {} started querying", getTestName());
Expand All @@ -329,6 +329,10 @@ protected void doRun() throws Exception {
TimeValue elapsed = TimeValue.timeValueNanos(System.nanoTime() - startedTimeInNanos);
logger.info("--> test {} triggering OOM after {}", getTestName(), elapsed);
Request triggerOOM = new Request("POST", "/_trigger_out_of_memory");
RequestConfig requestConfig = RequestConfig.custom()
.setSocketTimeout(Math.toIntExact(TimeValue.timeValueMinutes(2).millis()))
.build();
request.setOptions(RequestOptions.DEFAULT.toBuilder().setRequestConfig(requestConfig));
client().performRequest(triggerOOM);
}
}, TimeValue.timeValueMinutes(5), testThreadPool.executor(ThreadPool.Names.GENERIC));
Expand Down