Skip to content

Commit c8665be

Browse files
Hyaskseanmonstar
authored andcommitted
tests: use a documented test network for testing
10.255.255.0/24 is part of 10.0.0.0/8 and reserved for "Private Use" by IANA [1]. That means that those IP might be in use in some internal networks, making the timeout tests to fail on those networks. One example of such network is the Ubuntu testing infrastructure. Changing for a documented "Test network", that is supposed to never be routable [2] makes the tests to have a better chance to pass in most network contexts. [1]: https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml [2]: https://www.rfc-editor.org/rfc/rfc5737.html
1 parent 964b1c6 commit c8665be

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/timeouts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async fn connect_timeout() {
7676
.build()
7777
.unwrap();
7878

79-
let url = "http://10.255.255.1:81/slow";
79+
let url = "http://192.0.2.1:81/slow";
8080

8181
let res = client
8282
.get(url)
@@ -100,7 +100,7 @@ async fn connect_many_timeout_succeeds() {
100100
let client = reqwest::Client::builder()
101101
.resolve_to_addrs(
102102
"many_addrs",
103-
&["10.255.255.1:81".parse().unwrap(), server.addr()],
103+
&["192.0.2.1:81".parse().unwrap(), server.addr()],
104104
)
105105
.connect_timeout(Duration::from_millis(100))
106106
.no_proxy()
@@ -126,8 +126,8 @@ async fn connect_many_timeout() {
126126
.resolve_to_addrs(
127127
"many_addrs",
128128
&[
129-
"10.255.255.1:81".parse().unwrap(),
130-
"10.255.255.2:81".parse().unwrap(),
129+
"192.0.2.1:81".parse().unwrap(),
130+
"192.0.2.2:81".parse().unwrap(),
131131
],
132132
)
133133
.connect_timeout(Duration::from_millis(100))

0 commit comments

Comments
 (0)