Shorten --max-time in tests and use a more stable error check (#14494)

- fixes flakey tests from solving #14241

# Description
This is a preliminary fix for the flaky tests and also
shortened the `--max-time` in the tests.

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->



---------

Signed-off-by: Alex Kattathra Johnson <alex.kattathra.johnson@gmail.com>
This commit is contained in:
Alex Kattathra Johnson
2024-12-06 06:03:13 -06:00
committed by GitHub
parent 81d68cd478
commit cda9ae1e42
7 changed files with 69 additions and 24 deletions

View File

@ -1544,8 +1544,8 @@ impl From<io::Error> for ShellError {
impl From<Spanned<io::Error>> for ShellError {
fn from(error: Spanned<io::Error>) -> Self {
let Spanned { item: error, span } = error;
if error.kind() == io::ErrorKind::Other {
match error.into_inner() {
match error.kind() {
io::ErrorKind::Other => match error.into_inner() {
Some(err) => match err.downcast() {
Ok(err) => *err,
Err(err) => Self::IOErrorSpanned {
@ -1557,12 +1557,15 @@ impl From<Spanned<io::Error>> for ShellError {
msg: "unknown error".into(),
span,
},
}
} else {
Self::IOErrorSpanned {
},
io::ErrorKind::TimedOut => Self::NetworkFailure {
msg: error.to_string(),
span,
}
},
_ => Self::IOErrorSpanned {
msg: error.to_string(),
span,
},
}
}
}