Skip to content

Commit

Permalink
Auto merge of #713 - Skgland:spurious-errors, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
detect new spuroius error and fix a regression considered spurious

- change from TestFail to non-spuriouse BuildFail is a regression (#703)
- no space left on drive is spuriouse (#700)
  • Loading branch information
bors committed Nov 25, 2023
2 parents 4ebb543 + 1ba0233 commit 434a549
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/report/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ impl ResultName for FailureReason {
FailureReason::NetworkAccess => "network access".into(),
FailureReason::OOM => "OOM".into(),
FailureReason::ICE => "ICE".into(),
FailureReason::NoSpace => "no space left on device".into(),
FailureReason::CompilerError(_) => "compiler error".into(),
FailureReason::DependsOn(_) => "faulty deps".into(),
FailureReason::CompilerDiagnosticChange => "compiler diagnostic changed".into(),
Expand All @@ -28,6 +29,7 @@ impl ResultName for FailureReason {
| FailureReason::NetworkAccess
| FailureReason::Timeout
| FailureReason::OOM
| FailureReason::NoSpace
| FailureReason::CompilerDiagnosticChange
| FailureReason::ICE => self.short_name(),
}
Expand Down
4 changes: 2 additions & 2 deletions src/report/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ fn compare(
| (BuildFail(_), TestSkipped)
| (BuildFail(_), TestPass)
| (TestFail(_), TestPass) => Comparison::Fixed,

(TestFail(_), BuildFail(reason)) if !reason.is_spurious() => Comparison::Regressed,
(TestFail(reason1), BuildFail(reason2))
if reason1.is_spurious() || reason2.is_spurious() =>
{
Expand Down Expand Up @@ -831,6 +831,7 @@ mod tests {
TestPass, BuildFail(Unknown) => Regressed;
TestSkipped, BuildFail(Unknown) => Regressed;
TestFail(Unknown), BuildFail(Unknown) => Regressed;
TestFail(OOM), BuildFail(Unknown) => Regressed;

// ICE is special
BuildFail(Unknown), BuildFail(ICE) => Regressed;
Expand All @@ -846,7 +847,6 @@ mod tests {
TestPass, TestFail(OOM) => SpuriousRegressed;
TestPass, BuildFail(OOM) => SpuriousRegressed;
TestSkipped, BuildFail(OOM) => SpuriousRegressed;
TestFail(OOM), BuildFail(Unknown) => SpuriousRegressed;
TestFail(Unknown), BuildFail(OOM) => SpuriousRegressed;

// Errors
Expand Down
5 changes: 5 additions & 0 deletions src/results/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ impl ::std::str::FromStr for DiagnosticCode {
pub enum FailureReason {
Unknown,
OOM,
NoSpace,
Timeout,
ICE,
NetworkAccess,
Expand All @@ -209,6 +210,7 @@ impl ::std::fmt::Display for FailureReason {
match self {
FailureReason::Unknown => write!(f, "unknown"),
FailureReason::OOM => write!(f, "oom"),
FailureReason::NoSpace => write!(f, "no-space"),
FailureReason::Timeout => write!(f, "timeout"),
FailureReason::ICE => write!(f, "ice"),
FailureReason::NetworkAccess => write!(f, "network-access"),
Expand Down Expand Up @@ -265,6 +267,7 @@ impl ::std::str::FromStr for FailureReason {
"oom" => Ok(FailureReason::OOM),
"timeout" => Ok(FailureReason::Timeout),
"ice" => Ok(FailureReason::ICE),
"no-space" => Ok(FailureReason::NoSpace),
_ => bail!("unexpected value: {}", s),
}
}
Expand All @@ -275,6 +278,7 @@ impl FailureReason {
pub(crate) fn is_spurious(&self) -> bool {
match *self {
FailureReason::OOM
| FailureReason::NoSpace
| FailureReason::Timeout
| FailureReason::NetworkAccess
| FailureReason::CompilerDiagnosticChange => true,
Expand Down Expand Up @@ -351,6 +355,7 @@ mod tests {
"build-fail:compiler-error(001)" => BuildFail(CompilerError(btreeset!["001".parse().unwrap()])),
"build-fail:oom" => BuildFail(OOM),
"build-fail:ice" => BuildFail(ICE),
"build-fail:no-space" => BuildFail(NoSpace),
"test-fail:timeout" => TestFail(Timeout),
"test-pass" => TestPass,
"error" => Error,
Expand Down
6 changes: 6 additions & 0 deletions src/runner/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ fn run_cargo<DB: WriteResults>(
let mut did_ice = false;
let mut did_network = false;
let mut did_trybuild = false;
let mut ran_out_of_space = false;
let mut error_codes = BTreeSet::new();
let mut deps = BTreeSet::new();

Expand All @@ -122,6 +123,9 @@ fn run_cargo<DB: WriteResults>(
if line.contains("Address already in use") {
did_network = true;
}
if line.to_lowercase().contains("no space left on device") {
ran_out_of_space = true;
}
if line.contains("code: 111") && line.contains("Connection refused") {
did_network = true;
}
Expand Down Expand Up @@ -205,6 +209,8 @@ fn run_cargo<DB: WriteResults>(
Err(e.context(FailureReason::NetworkAccess).into())
} else if did_trybuild {
Err(e.context(FailureReason::CompilerDiagnosticChange).into())
} else if ran_out_of_space {
Err(e.context(FailureReason::NoSpace).into())
} else {
Err(e.into())
}
Expand Down

0 comments on commit 434a549

Please sign in to comment.