mirror of https://github.com/astral-sh/uv
Increase the number of retries during test runs in CI (#14565)
This commit is contained in:
parent
081e2010df
commit
ee35fe34ab
|
|
@ -223,6 +223,9 @@ jobs:
|
||||||
tool: cargo-nextest
|
tool: cargo-nextest
|
||||||
|
|
||||||
- name: "Cargo test"
|
- name: "Cargo test"
|
||||||
|
env:
|
||||||
|
# Retry more than default to reduce flakes in CI
|
||||||
|
UV_HTTP_RETRIES: 5
|
||||||
run: |
|
run: |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--features python-patch \
|
--features python-patch \
|
||||||
|
|
@ -256,6 +259,9 @@ jobs:
|
||||||
tool: cargo-nextest
|
tool: cargo-nextest
|
||||||
|
|
||||||
- name: "Cargo test"
|
- name: "Cargo test"
|
||||||
|
env:
|
||||||
|
# Retry more than default to reduce flakes in CI
|
||||||
|
UV_HTTP_RETRIES: 5
|
||||||
run: |
|
run: |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--no-default-features \
|
--no-default-features \
|
||||||
|
|
@ -300,6 +306,8 @@ jobs:
|
||||||
- name: "Cargo test"
|
- name: "Cargo test"
|
||||||
working-directory: ${{ env.UV_WORKSPACE }}
|
working-directory: ${{ env.UV_WORKSPACE }}
|
||||||
env:
|
env:
|
||||||
|
# Retry more than default to reduce flakes in CI
|
||||||
|
UV_HTTP_RETRIES: 5
|
||||||
# Avoid permission errors during concurrent tests
|
# Avoid permission errors during concurrent tests
|
||||||
# See https://github.com/astral-sh/uv/issues/6940
|
# See https://github.com/astral-sh/uv/issues/6940
|
||||||
UV_LINK_MODE: copy
|
UV_LINK_MODE: copy
|
||||||
|
|
|
||||||
|
|
@ -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
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ use std::{env, io};
|
||||||
use assert_fs::fixture::{ChildPath, FileWriteStr, PathChild};
|
use assert_fs::fixture::{ChildPath, FileWriteStr, PathChild};
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
use uv_static::EnvVars;
|
||||||
use wiremock::matchers::method;
|
use wiremock::matchers::method;
|
||||||
use wiremock::{Mock, MockServer, ResponseTemplate};
|
use wiremock::{Mock, MockServer, ResponseTemplate};
|
||||||
|
|
||||||
|
|
@ -48,7 +49,9 @@ async fn simple_http_500() {
|
||||||
.pip_install()
|
.pip_install()
|
||||||
.arg("tqdm")
|
.arg("tqdm")
|
||||||
.arg("--index-url")
|
.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
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -72,7 +75,9 @@ async fn simple_io_err() {
|
||||||
.pip_install()
|
.pip_install()
|
||||||
.arg("tqdm")
|
.arg("tqdm")
|
||||||
.arg("--index-url")
|
.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
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -99,7 +104,9 @@ async fn find_links_http_500() {
|
||||||
.arg("tqdm")
|
.arg("tqdm")
|
||||||
.arg("--no-index")
|
.arg("--no-index")
|
||||||
.arg("--find-links")
|
.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
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -125,7 +132,9 @@ async fn find_links_io_error() {
|
||||||
.arg("tqdm")
|
.arg("tqdm")
|
||||||
.arg("--no-index")
|
.arg("--no-index")
|
||||||
.arg("--find-links")
|
.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
|
success: false
|
||||||
exit_code: 2
|
exit_code: 2
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -154,7 +163,9 @@ async fn direct_url_http_500() {
|
||||||
let filters = vec![(mock_server_uri.as_str(), "[SERVER]")];
|
let filters = vec![(mock_server_uri.as_str(), "[SERVER]")];
|
||||||
uv_snapshot!(filters, context
|
uv_snapshot!(filters, context
|
||||||
.pip_install()
|
.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
|
success: false
|
||||||
exit_code: 1
|
exit_code: 1
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -180,7 +191,9 @@ async fn direct_url_io_error() {
|
||||||
let filters = vec![(mock_server_uri.as_str(), "[SERVER]")];
|
let filters = vec![(mock_server_uri.as_str(), "[SERVER]")];
|
||||||
uv_snapshot!(filters, context
|
uv_snapshot!(filters, context
|
||||||
.pip_install()
|
.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
|
success: false
|
||||||
exit_code: 1
|
exit_code: 1
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -239,7 +252,9 @@ async fn python_install_http_500() {
|
||||||
.python_install()
|
.python_install()
|
||||||
.arg("cpython-3.10.0-darwin-aarch64-none")
|
.arg("cpython-3.10.0-darwin-aarch64-none")
|
||||||
.arg("--python-downloads-json-url")
|
.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
|
success: false
|
||||||
exit_code: 1
|
exit_code: 1
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
@ -269,7 +284,9 @@ async fn python_install_io_error() {
|
||||||
.python_install()
|
.python_install()
|
||||||
.arg("cpython-3.10.0-darwin-aarch64-none")
|
.arg("cpython-3.10.0-darwin-aarch64-none")
|
||||||
.arg("--python-downloads-json-url")
|
.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
|
success: false
|
||||||
exit_code: 1
|
exit_code: 1
|
||||||
----- stdout -----
|
----- stdout -----
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue