diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0d8e18a3..ba7a4b4d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -223,6 +223,9 @@ jobs: tool: cargo-nextest - name: "Cargo test" + env: + # Retry more than default to reduce flakes in CI + UV_HTTP_RETRIES: 5 run: | cargo nextest run \ --features python-patch \ @@ -256,6 +259,9 @@ jobs: tool: cargo-nextest - name: "Cargo test" + env: + # Retry more than default to reduce flakes in CI + UV_HTTP_RETRIES: 5 run: | cargo nextest run \ --no-default-features \ @@ -300,6 +306,8 @@ jobs: - name: "Cargo test" working-directory: ${{ env.UV_WORKSPACE }} env: + # Retry more than default to reduce flakes in CI + UV_HTTP_RETRIES: 5 # Avoid permission errors during concurrent tests # See https://github.com/astral-sh/uv/issues/6940 UV_LINK_MODE: copy diff --git a/crates/uv/tests/it/edit.rs b/crates/uv/tests/it/edit.rs index 18170cff9..ddaed434f 100644 --- a/crates/uv/tests/it/edit.rs +++ b/crates/uv/tests/it/edit.rs @@ -11877,7 +11877,9 @@ async fn add_unexpected_error_code() -> Result<()> { "# })?; - uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--index").arg(server.uri()), @r" + uv_snapshot!(context.filters(), context.add().arg("anyio").arg("--index").arg(server.uri()) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 2 ----- stdout ----- diff --git a/crates/uv/tests/it/network.rs b/crates/uv/tests/it/network.rs index 1a5805970..a9376e07e 100644 --- a/crates/uv/tests/it/network.rs +++ b/crates/uv/tests/it/network.rs @@ -3,6 +3,7 @@ use std::{env, io}; use assert_fs::fixture::{ChildPath, FileWriteStr, PathChild}; use http::StatusCode; use serde_json::json; +use uv_static::EnvVars; use wiremock::matchers::method; use wiremock::{Mock, MockServer, ResponseTemplate}; @@ -48,7 +49,9 @@ async fn simple_http_500() { .pip_install() .arg("tqdm") .arg("--index-url") - .arg(&mock_server_uri), @r" + .arg(&mock_server_uri) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 2 ----- stdout ----- @@ -72,7 +75,9 @@ async fn simple_io_err() { .pip_install() .arg("tqdm") .arg("--index-url") - .arg(&mock_server_uri), @r" + .arg(&mock_server_uri) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 2 ----- stdout ----- @@ -99,7 +104,9 @@ async fn find_links_http_500() { .arg("tqdm") .arg("--no-index") .arg("--find-links") - .arg(&mock_server_uri), @r" + .arg(&mock_server_uri) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 2 ----- stdout ----- @@ -125,7 +132,9 @@ async fn find_links_io_error() { .arg("tqdm") .arg("--no-index") .arg("--find-links") - .arg(&mock_server_uri), @r" + .arg(&mock_server_uri) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 2 ----- stdout ----- @@ -154,7 +163,9 @@ async fn direct_url_http_500() { let filters = vec![(mock_server_uri.as_str(), "[SERVER]")]; uv_snapshot!(filters, context .pip_install() - .arg(format!("tqdm @ {tqdm_url}")), @r" + .arg(format!("tqdm @ {tqdm_url}")) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 1 ----- stdout ----- @@ -180,7 +191,9 @@ async fn direct_url_io_error() { let filters = vec![(mock_server_uri.as_str(), "[SERVER]")]; uv_snapshot!(filters, context .pip_install() - .arg(format!("tqdm @ {tqdm_url}")), @r" + .arg(format!("tqdm @ {tqdm_url}")) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 1 ----- stdout ----- @@ -239,7 +252,9 @@ async fn python_install_http_500() { .python_install() .arg("cpython-3.10.0-darwin-aarch64-none") .arg("--python-downloads-json-url") - .arg(python_downloads_json.path()), @r" + .arg(python_downloads_json.path()) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 1 ----- stdout ----- @@ -269,7 +284,9 @@ async fn python_install_io_error() { .python_install() .arg("cpython-3.10.0-darwin-aarch64-none") .arg("--python-downloads-json-url") - .arg(python_downloads_json.path()), @r" + .arg(python_downloads_json.path()) + .env_remove(EnvVars::UV_HTTP_RETRIES) + .env(EnvVars::UV_TEST_NO_HTTP_RETRY_DELAY, "true"), @r" success: false exit_code: 1 ----- stdout -----