Skip to content

Set request timeout only for the read timeout test#19025

Merged
laurit merged 2 commits into
open-telemetry:mainfrom
laurit:async-http-client-timeout
Jun 17, 2026
Merged

Set request timeout only for the read timeout test#19025
laurit merged 2 commits into
open-telemetry:mainfrom
laurit:async-http-client-timeout

Conversation

Copilot AI review requested due to automatic review settings June 17, 2026 09:19
@laurit laurit requested a review from a team as a code owner June 17, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky highConcurrencyWithCallback() test in AsyncHttpClientCompletableFutureTest by setting the request timeout only for the read-timeout test, rather than applying it globally to all requests. Previously, the shared client configured a request timeout equal to the connection timeout (5s), which could cause spurious timeouts under high concurrency. Now, a second client instance with the read timeout is used exclusively for /read-timeout requests.

Changes:

  • Introduce two separate AsyncHttpClient instances: one without a request timeout (default) and one with a read timeout, selected by a getClient(URI) method based on the request path.
  • Update sendRequest and sendRequestWithCallback in both AsyncHttpClientTest and AsyncHttpClientCompletableFutureTest to route through getClient(uri) for client selection.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
instrumentation/async-http-client/async-http-client-2.0/javaagent/src/test/java/…/AsyncHttpClientTest.java Adds two client instances, a buildClient factory, a getClient(URI) method for path-based client selection, and updates configureTimeout to conditionally set the request timeout.
instrumentation/async-http-client/async-http-client-2.0/javaagent/src/test/java/…/AsyncHttpClientCompletableFutureTest.java Updates sendRequestWithCallback to use getClient(uri) instead of the direct client field.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@laurit laurit merged commit 23da760 into open-telemetry:main Jun 17, 2026
95 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants