From 024cf5a1040279aa60fa420270cd0895b275581e Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Wed, 15 Jul 2026 09:03:01 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20pin=20sys.platform=3Dlinux=20in=20test?= =?UTF-8?q?=5Fis=5Fpid=5Falive=5Fdead=20=E2=80=94=20Windows=20runners=20ta?= =?UTF-8?q?ke=20the=20OpenProcess=20path=20so=20the=20os.kill=20mock=20nev?= =?UTF-8?q?er=20fires;=20test=20reds=20whenever=20PID=201234=20is=20alive?= =?UTF-8?q?=20on=20the=20runner=20(first=20hit=20today,=206/6=20sibling=20?= =?UTF-8?q?tests=20were=20already=20pinned=20by=20ca096295).=2038=20presen?= =?UTF-8?q?ce=20tests=20green.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 9 +++++++++ src/aipass/hooks/tests/test_presence.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb803b20..db6805f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,15 @@ PyPI version — not the changelog header. (9.3k → 7.9k chars, under its ~8k injection cap) with the comms doctrine intact. +- **Windows flake pinned: `test_is_pid_alive_dead` escaped the ca096295 + sweep.** That commit's rule — tests mocking `os.kill` must pin + `sys.platform="linux"` because Windows takes the ctypes OpenProcess path and + never reaches the mock — was applied to every pid-liveness test except this + one. It only failed when PID 1234 happened to be alive on the runner + (environment lottery, first hit today). Pinned like its siblings. The + remaining Windows session_boot reds and the relay mtime-cache flake predate + this PR and stay parked. + ## [2026-07-14] ### Fixed diff --git a/src/aipass/hooks/tests/test_presence.py b/src/aipass/hooks/tests/test_presence.py index a715f22e..f771d87f 100644 --- a/src/aipass/hooks/tests/test_presence.py +++ b/src/aipass/hooks/tests/test_presence.py @@ -431,7 +431,7 @@ class TestLiveness: mock_kill.assert_called_once_with(1234, 0) def test_is_pid_alive_dead(self): - with patch("os.kill", side_effect=ProcessLookupError): + with patch("sys.platform", "linux"), patch("os.kill", side_effect=ProcessLookupError): assert presence._is_pid_alive(1234) is False def test_is_pid_alive_permission_error(self):