Commit 297624e
committed
Bind test servers to loopback address
Binding to 0.0.0.0 is not guaranteed to result in a socket that is
reachable via the loopback address, even when requesting an ephemeral
port assignment by binding to port 0. It is possible for another process
on the system to bind to the loopback address at that same port, and
then client requests will go to that process instead of the test server,
resulting in occasional cryptic test failures.
By instead binding to the loopback address specifically, rather than the
wildcard address, we can prevent binding to a port that is already in
use. This significantly improves the reliability of the test suite.1 parent 7746feb commit 297624e
File tree
3 files changed
+6
-3
lines changed- httpclient5-testing/src/test/java/org/apache/hc/client5/testing
- httpclient5/src/test/java/org/apache/hc/client5/http
- examples
- impl/async
3 files changed
+6
-3
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
| 82 | + | |
82 | 83 | | |
83 | 84 | | |
84 | 85 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
145 | | - | |
| 146 | + | |
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
0 commit comments