rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.01k stars 875 forks source link

Tests relying on `reqwest::Client` may fail with "dispatch task is gone: runtime dropped the dispatch task" #3852

Open rami3l opened 4 weeks ago

rami3l commented 4 weeks ago

Verification

Problem

This is causing irregular failures for different CI platforms:

The error message here is identical (although the exact test that failed might differ):

running 395 tests
...
test suite::cli_exact::check_updates_with_update ... FAILED
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-updateD58GcC/release-stable.toml': failed to make network request: error sending request for url (https://static.rust-lang.org/rustup/release-stable.toml): client error (SendRequest): dispatch task is gone: runtime dropped the dispatch task

Notes

Possibly related to https://github.com/hyperium/hyper/issues/2312, https://github.com/Azure/azure-sdk-for-rust/pull/1550 or https://github.com/fussybeaver/bollard/issues/387#issuecomment-2008133973.

I'm pretty sure that #3367 has caused this.

rami3l commented 3 weeks ago

According to the error message format and my IDE searching the current codebase, this is a RustupError::DownloadingFile. This kind error message can only be emitted from here:

https://github.com/rust-lang/rustup/blob/6d4376180d10e35daec5453546e508eb4726fa52/src/utils/utils.rs#L154-L190