-
Notifications
You must be signed in to change notification settings - Fork 983
Add integration tests for connection timeouts #640
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
Conversation
|
Odd that the tests fail only on macOS. |
|
They do? I developed them on macOS, and my |
|
I saw these failures: https://github.com/apache/httpcomponents-client/actions/runs/15425891897 We're they random? |
|
Those are JDK17/JDK21 failures occasioned by a change in capitalization. JDK8 and JDK11 report There are some cases in integration testing where there are significant differences between Linux and macOS, such as the default loopback addresses, but to my knowledge this PR isn't affected by them. |
fac7043 to
b945bfa
Compare
...5-testing/src/test/java/org/apache/hc/client5/testing/async/TestAsyncConnectionTimeouts.java
Show resolved
Hide resolved
...client5-testing/src/test/java/org/apache/hc/client5/testing/sync/TestConnectionTimeouts.java
Show resolved
Hide resolved
This change adds basic integration test coverage for connection timeouts for the sync and async clients. The tests work by sending a request to a non-routable IP address, with timeouts configured two different ways (`ConnectionConfig` and `RequestConfig`), using both HTTP and HTTPS. The connection request gets blackholed pretty reliably, and then the tests assert that we actually waited a reasonable length of time with respect to the configured timeout. Finally, there are some client-specific assertions for the type and content of the exception thrown.
|
We need Windows tests in the CI I think: I have Rancher Desktop 1.18.2 installed if that matters. |
|
Windows CI builds were disabled in 2022 due to "intermittent network failures." I'm not sure what that means. Do any of these tests talk to the internet? |
@rschmitt @garydgregory That means that some integration tests fail intermittently with connection reset for no obvious reasons on Windows only. The same tests always pass on Ubuntu and MacOS. I tried really hard to find the cause of those failures to no avail. I will have to disable tests on Windows again if the problem recurs. |
This change adds basic integration test coverage for connection timeouts for the sync and async clients. The tests work by sending a request to a non-routable IP address, with timeouts configured two different ways (
ConnectionConfigandRequestConfig), using both HTTP and HTTPS. The connection request gets blackholed pretty reliably, and then the tests assert that we actually waited a reasonable length of time with respect to the configured timeout. Finally, there are some client-specific assertions for the type and content of the exception thrown.