Compare commits

...

3 Commits

Author SHA1 Message Date
jmwample 456574c520 update comments 2026-05-22 12:38:53 -06:00
jmwample acc7d45550 disable test relying on live network behavior 2026-05-22 12:36:47 -06:00
jmwample f1690f9953 fix test for url rotation 2026-05-22 12:03:21 -06:00
+14 -6
View File
@@ -324,12 +324,15 @@ mod tests {
}
#[tokio::test]
// NOTE THIS TEST IS DISABLED BECAUSE IT INTERACTS WITH LIVE NETWORK AND EXPECTS
// SPECIFIC BEHAVIOR. Keeping in case logic changes and needs tested locally.
#[cfg(any())] // #[ignore] we run --ignore in CI/CD assuming it just means slow -_-
async fn fallback_on_failure() {
let url1 = Url::new(
"https://fake-domain.nymtech.net",
Some(vec![
"https://fake-front-1.nymtech.net",
"https://fake-front-2.nymtech.net",
"https://wrong.host.badssl.com/",
"https://untrusted-root.badssl.com/",
]),
)
.unwrap();
@@ -339,8 +342,12 @@ mod tests {
)
.unwrap(); // fastly
// use non-shared client and no-hickory so that we aren't reliant on a shared http client
// that could be impacted by independent interleaved tests.
let client = ClientBuilder::new_with_urls(vec![url1, url2])
.expect("bad url")
.non_shared()
.no_hickory_dns()
.with_fronting(Some(FrontPolicy::Always))
.build()
.expect("failed to build client");
@@ -352,7 +359,7 @@ mod tests {
);
assert_eq!(
client.current_url().front_str(),
Some("fake-front-1.nymtech.net"),
Some("wrong.host.badssl.com"),
);
let result = client
@@ -365,14 +372,14 @@ mod tests {
.await;
assert!(result.is_err());
// Check that the host configuration updated the front on error.
// Check that the host configuration updated the front on error (tls error wring host)
assert_eq!(
client.current_url().as_str(),
"https://fake-domain.nymtech.net/",
);
assert_eq!(
client.current_url().front_str(),
Some("fake-front-2.nymtech.net"),
Some("untrusted-root.badssl.com"),
);
let result = client
@@ -385,7 +392,8 @@ mod tests {
.await;
assert!(result.is_err());
// Check that the host configuration updated the domain and front on error.
// Check that the host configuration updated the domain and front on error (tls error
// untrusted root)
assert_eq!(
client.current_url().as_str(),
"https://validator.global.ssl.fastly.net/",