Repository navigation
test(session-registry): reader tests set the window pid on every platform (#692) - #945
Conversation
…form (#692) The reader tests faked os.getppid, which only the POSIX branch of _window_claude_pid reads. On Windows the reader walked the runner's real process table, found no claude.exe and read no entry: 5 failures in run 38008915302 (job 114084097957), and the tests expecting None passed there without reading the file. They now patch _window_claude_pid; the POSIX ancestor-walk tests pin IS_WINDOWS False; a new test pins the POSIX mapping. Refs #692 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYqm5ErgxixPH4n5uiq
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 1m 43s —— View job PR #945 review (review 1 of 3)
No Blockers. All five reviews came back clean. The review comment has three notes that need no action before merge. I could not run pytest or ruff in this job because the commands were not permitted. The result rests on reading the code and on the passing Pipeline run. Verdict: approve |
Review 1 of 3: PR #945 (commit 0fd1dad)I ran five reviews on this PR: code quality, test coverage, docs accuracy, security and performance. None found a Blocker. I checked the change against
Notes, no action before merge
Verdict: approve |
|
Thanks. On the three notes, no change in this PR:
Generated by Claude Code |
Summary
Next slice of #692 (class 5,
test_session_registry, 5 Windows failures in run 38008915302, job 114084097957):test_write_and_read_nominal,test_tombstone_reads_as_none,test_ancestor_walk_finds_claude,test_cached_start_signature_hits_after_first_call,test_session_id_change_seen_immediately_despite_cached_signature(assert None == 'stem-abc',assert None == 100, …).Root cause (test defect, not product): the reader tests chose the window by faking
os.getppid. Only the POSIX branch of_window_claude_pidreads it. On Windows the reader takes the ADR-1096 branch, walks the runner's real process table, finds noclaude.exeand reads no entry. The same goes forfind_claude_ancestor, whose Windows branch ignores thepsprobe the test fakes. The reader tests that expectNone(corrupted JSON, unknown version, pid mismatch, start-time divergence, dead pid) passed on Windows without reading the file at all.Change (tests only):
_as_window(monkeypatch, pid)setssr._window_claude_piditself, so the registry-file tests exercise the same reader path on every platform.IS_WINDOWS = False, liketest_session_registry_posix_root.pyandtest_posix_ps.pyalready do. The Windows walk keeps its own tests intest_session_registry_windows.py.test_posix_window_is_the_parent_processpins the POSIX mapping that thegetppidpatches used to cover implicitly.No production code change.
Refs #692
Type of change
Test plan
pytest tests_py/infrastructure/test_session_registry.py test_session_registry_windows.py test_session_registry_posix_root.py test_posix_ps.py: 55 passed (Linux).pytest tests_py/infrastructure -k "session_registry or process_ancestry or posix_ps or groomer_identity": 84 passed, 19 skipped.IS_WINDOWS = True, the ancestor walk finds noclaude.exe, as on the CI runner): onmainthe 5 failing ids of the log fail, and only those; on this branch the same tests plus the new one pass (7 passed).ruff check/ruff format --check(ruff version fromuv.lock) on the touched file: clean.python scripts/check_craftsmanship.py: OK.Not verified: nothing ran on real Windows. Local env installed from
uv.lockwithout torch/sentence-transformers (download.pytorch.org unreachable here); the touched tests do not import them.Audit notes
Coding-standards compliance
Reviewer checklist
Generated by Claude Code