fix: unpark the parked CI reds — Patrick ruling: red CI is never parked. @prax: relay mtime-cache flake root-caused (test relied on two writes sharing one mtime-granularity window — true locally, false on CI) — os.utime pins mtime so the cache contract tests deterministically, 50/50+20/20 loops green. @hooks: 4 Windows session_boot reds — _tmux_session_exists() real subprocess spawn (no tmux on Windows, WinError 2) mocked per ca096295 convention, execvp already mocked = zero real spawns left. 1028 prax + 102 session_boot green, devpulse-verified.
This commit is contained in:
@@ -206,6 +206,7 @@ class TestBoot:
|
||||
patch.object(session_boot, "_find_live_sessions", return_value=live),
|
||||
patch.object(session_boot, "_read_choice", return_value=""),
|
||||
patch.object(session_boot, "_find_tmux_session_for_pid", return_value=None),
|
||||
patch.object(session_boot, "_tmux_session_exists", return_value=False),
|
||||
patch(f"{_MOD}.os.execvp") as mock_exec,
|
||||
):
|
||||
session_boot.boot(cwd=str(tmp_path))
|
||||
@@ -264,6 +265,7 @@ class TestBoot:
|
||||
patch.object(session_boot, "_find_tmux", return_value="/usr/bin/tmux"),
|
||||
patch.object(session_boot, "_find_live_sessions", return_value=[]),
|
||||
patch.object(session_boot, "_read_choice", return_value=""),
|
||||
patch.object(session_boot, "_tmux_session_exists", return_value=False),
|
||||
patch(f"{_MOD}.os.execvp") as mock_exec,
|
||||
):
|
||||
session_boot.boot(cwd=str(tmp_path))
|
||||
@@ -892,6 +894,7 @@ class TestExtraArgsThreading:
|
||||
patch.object(session_boot, "_find_tmux", return_value="/usr/bin/tmux"),
|
||||
patch.object(session_boot, "_find_live_sessions", return_value=[]),
|
||||
patch.object(session_boot, "_read_choice", return_value=""),
|
||||
patch.object(session_boot, "_tmux_session_exists", return_value=False),
|
||||
patch(f"{_MOD}.os.execvp") as mock_exec,
|
||||
):
|
||||
session_boot.boot(cwd=str(tmp_path), extra_args=["--permission-mode", "plan"])
|
||||
@@ -1065,6 +1068,7 @@ class TestAutoNamer:
|
||||
patch.object(session_boot, "_find_tmux", return_value="/usr/bin/tmux"),
|
||||
patch.object(session_boot, "_find_live_sessions", return_value=[]),
|
||||
patch.object(session_boot, "_read_choice", return_value=""),
|
||||
patch.object(session_boot, "_tmux_session_exists", return_value=False),
|
||||
patch(f"{_MOD}.os.execvp") as mock_exec,
|
||||
):
|
||||
session_boot.boot(cwd=str(tmp_path))
|
||||
|
||||
@@ -450,12 +450,16 @@ class TestReadControl:
|
||||
|
||||
def test_mtime_cache_avoids_reread(self, tmp_path):
|
||||
"""Same mtime returns cached result without re-reading the file."""
|
||||
import os
|
||||
|
||||
relay = _import_relay()
|
||||
ctrl = tmp_path / "control.json"
|
||||
ctrl.write_text(json.dumps({"paused": False}))
|
||||
setattr(relay, "CONTROL_FILE", ctrl)
|
||||
first = relay._read_control()
|
||||
cached_mtime = ctrl.stat().st_mtime
|
||||
ctrl.write_text("INVALID JSON")
|
||||
os.utime(ctrl, (cached_mtime, cached_mtime))
|
||||
result = relay._read_control()
|
||||
assert result == first
|
||||
|
||||
|
||||
Reference in New Issue
Block a user