test(maestro): skip sidecar-rollback test under root (pre-existing CI red)
ci / rust (push) Successful in 2m37s

CI runs as root, where the 0o500 read-only sidecar dir doesn't block the
write the test relies on failing — so it reported a spurious failure and
has reddened main since commit 149. Probe writability and skip when root;
non-root runs still assert the rollback.
This commit is contained in:
2026-06-15 21:28:47 +00:00
parent 3aedd7a0a5
commit 977800951d
@@ -84,6 +84,19 @@ async fn create_rolls_back_tmux_session_when_sidecar_write_fails() {
std::fs::create_dir_all(&sidecar_dir).unwrap();
std::fs::set_permissions(&sidecar_dir, std::fs::Permissions::from_mode(0o500)).unwrap();
// The failure is injected by making the sidecar dir read-only — but root
// bypasses directory permission bits, so the write would succeed and the
// rollback path never trigger. CI runs as root; detect that with a write
// probe and skip rather than report a spurious failure (the rollback is
// still covered in any non-root environment).
let probe = sidecar_dir.join(".perm_probe");
if std::fs::write(&probe, b"x").is_ok() {
let _ = std::fs::remove_file(&probe);
std::fs::set_permissions(&sidecar_dir, std::fs::Permissions::from_mode(0o700)).unwrap();
eprintln!("skipping: sidecar dir writable despite 0o500 (running as root?)");
return;
}
let res = fx
.manager
.create(CreateSessionRequest {