test(xy): restart cap escalates to failed
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user