test(xy): restart cap escalates to failed

This commit is contained in:
2026-05-25 12:05:45 +02:00
parent 434828c14e
commit 284b6e7402
+22
View File
@@ -0,0 +1,22 @@
mod common;
use common::*;
#[tokio::test]
async fn restart_cap_marks_failed() {
let xy = xy_bin();
let bad = exit_failure_bin();
let mut h = Harness::new();
h.write_server("flaky", bad.to_str().unwrap(), 19_010, "always");
h.start_daemon(&xy).await;
let mut saw_failed = false;
for _ in 0..60 {
let (_c, out, _e) = h.run_cli(&xy, &["list"]).await;
if out.contains("flaky") && out.contains("failed") {
saw_failed = true;
break;
}
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
}
assert!(saw_failed, "flaky never reached failed state");
}