Increase the number of retries during test runs in CI (#14565)

This commit is contained in:
Zanie Blue 2025-07-11 13:59:47 -05:00 committed by GitHub
parent 081e2010df
commit ee35fe34ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 9 deletions

View File

@ -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

View File

@ -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 -----

View File

@ -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 -----