From 342d2cdeed462684377a292496ac45f1f4c44a70 Mon Sep 17 00:00:00 2001 From: Florent 'Skia' Jacquet Date: Wed, 11 Sep 2024 16:13:45 +0200 Subject: [PATCH] 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 --- tests/timeouts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/timeouts.rs b/tests/timeouts.rs index 410d722f4..79a6fbb4d 100644 --- a/tests/timeouts.rs +++ b/tests/timeouts.rs @@ -76,7 +76,7 @@ async fn connect_timeout() { .build() .unwrap(); - let url = "http://10.255.255.1:81/slow"; + let url = "http://192.0.2.1:81/slow"; let res = client .get(url) @@ -100,7 +100,7 @@ async fn connect_many_timeout_succeeds() { let client = reqwest::Client::builder() .resolve_to_addrs( "many_addrs", - &["10.255.255.1:81".parse().unwrap(), server.addr()], + &["192.0.2.1:81".parse().unwrap(), server.addr()], ) .connect_timeout(Duration::from_millis(100)) .no_proxy() @@ -126,8 +126,8 @@ async fn connect_many_timeout() { .resolve_to_addrs( "many_addrs", &[ - "10.255.255.1:81".parse().unwrap(), - "10.255.255.2:81".parse().unwrap(), + "192.0.2.1:81".parse().unwrap(), + "192.0.2.2:81".parse().unwrap(), ], ) .connect_timeout(Duration::from_millis(100))