Skip to content

Comments

Add basic network error tests#13585

Merged
konstin merged 1 commit intomainfrom
konsti/basic-retry-tests
Jun 10, 2025
Merged

Add basic network error tests#13585
konstin merged 1 commit intomainfrom
konsti/basic-retry-tests

Conversation

@konstin
Copy link
Member

@konstin konstin commented May 21, 2025

Add basic tests for error messages on retryable network errors.

This test mod is intended to grow to ensure that we handle retryable errors correctly and that we show the appropriate error message if we failed after retrying.

The starter tests show some common cases we've seen download errors in: simple and find links indexes, file downloads and Python installs.

For io::Error fault injection to test the reqwest Err path besides the HTTP status code Ok path, see LukeMathWalker/wiremock-rs#149.

@konstin konstin added internal A refactor or improvement that is not user-facing error messages Messaging when something goes wrong network Network connectivity e.g. proxies, DNS, and SSL labels May 21, 2025
@konstin konstin force-pushed the konsti/basic-retry-tests branch 2 times, most recently from 58b128c to 93bbfd1 Compare May 23, 2025 18:54
konstin added a commit that referenced this pull request May 23, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
konstin added a commit that referenced this pull request May 26, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
konstin added a commit that referenced this pull request May 26, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
konstin added a commit that referenced this pull request May 26, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
konstin added a commit that referenced this pull request May 28, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
konstin added a commit that referenced this pull request May 28, 2025
Currently, it is not possible to set a custom Python downloads JSON on Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is currently failing CI)
zanieb pushed a commit that referenced this pull request May 28, 2025
Currently, it is not possible to set a custom Python downloads JSON on
Windows, as Windows paths can be valid URLs.

```rust
use url::Url;

fn main() {
    dbg!(Url::parse(r"C:\Users\Ferris\download.json"));
}
```

Tested by #13585 (where it is
currently failing CI).
@konstin konstin force-pushed the konsti/basic-retry-tests branch from 93bbfd1 to 0309430 Compare May 30, 2025 10:18
@konstin konstin requested a review from jtfmumm May 30, 2025 10:18
Add basic tests for error messages on retryable network errors.

This test mod is intended to grow to ensure that we handle retryable errors correctly and that we show the appropriate error message if we failed after retrying.

The starter tests show some common cases we've seen download errors in: simple and find links indexes, file downloads and Python installs.
@konstin konstin force-pushed the konsti/basic-retry-tests branch from 0309430 to ca60ba7 Compare June 7, 2025 10:11
async fn simple_http_500() {
let context = TestContext::new("3.12");

let server = MockServer::start().await;
Copy link
Contributor

@jtfmumm jtfmumm Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you can break this out into a separate function for use across these tests and just return the URI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've already broken this out in the follow up PR so it may not be necessary here if you've touched all these cases.

@konstin konstin merged commit c54f131 into main Jun 10, 2025
86 checks passed
@konstin konstin deleted the konsti/basic-retry-tests branch June 10, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Messaging when something goes wrong internal A refactor or improvement that is not user-facing network Network connectivity e.g. proxies, DNS, and SSL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants