From 977800951d10ec1fd48100b492fbec2ad56bdb44 Mon Sep 17 00:00:00 2001 From: naps62-yolo Date: Mon, 15 Jun 2026 21:28:47 +0000 Subject: [PATCH] test(maestro): skip sidecar-rollback test under root (pre-existing CI red) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- crates/maestro-daemon/tests/session_manager.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/crates/maestro-daemon/tests/session_manager.rs b/crates/maestro-daemon/tests/session_manager.rs index 22b7c2d..487d969 100644 --- a/crates/maestro-daemon/tests/session_manager.rs +++ b/crates/maestro-daemon/tests/session_manager.rs @@ -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 {