performance-metrics: Abort the run when a guest survives cleanup

When a test process group cannot be reaped, the host is left with an
orphaned guest whose ports and interfaces block later tests. Continuing
produces cascading failures that hide the original issue.

Treat a failed cleanup as a test error. By default the runner aborts,
and under --continue-on-failure it records the failure and keeps going.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-07-14 22:08:13 +02:00
committed by Rob Bradford
parent b53c339388
commit febe70ae36

View File

@@ -26,6 +26,8 @@ enum Error {
TestTimeout,
#[error("Error: test failed")]
TestFailed,
#[error("Error: guest process group survived cleanup")]
OrphanedGuest,
}
#[derive(Deserialize, Serialize)]
@@ -1757,9 +1759,17 @@ fn run_test_with_timeout(
})
.and_then(|r| r);
ProcessRegistry::cleanup(test.name);
let cleanup = ProcessRegistry::cleanup(test.name);
result
// Keep the test own error, else abort on a group that survived cleanup.
match (result, cleanup) {
(Err(e), _) => Err(e),
(Ok(_), Err(e)) => {
eprintln!("[Error] {e}");
Err(Error::OrphanedGuest)
}
(Ok(r), Ok(())) => Ok(r),
}
}
fn settle_host() {