Conversation
PR 2 of N in the Windows-CI green-up roadmap (after #711 fixed the path-separator class). Skips 9 tests across 5 files that exercise features which either don't exist on Windows or take a deliberately different code path that's already covered by an existing `test_windows_skips_kill`-style sibling. Pattern: single uniform `@pytest.mark.skipif(sys.platform == "win32", reason="…")` decorator. No assertion logic touched, no production source modified. POSIX file mode (4 tests): Windows ignores POSIX permission bits entirely, so `stat.S_IMODE(...)` always returns the NTFS-default 0o666 / 0o644 / 0o777 regardless of what the production code requests via `os.chmod` or `os.fchmod`. The intent under test (atomic_write defaults to 0o600 for state files, custom mode is honoured, install lands at 0o644) is meaningful only on POSIX. - `test_context_atomic.py::test_atomic_write_explicit_mode_0o600` - `test_context_atomic.py::test_atomic_write_respects_custom_mode` - `test_context_install.py::test_install_files_written_with_default_mode` - `test_context_settings.py::TestClaudeSettingsAtomicWrite::test_mode_is_0o600` `fcntl` (1 test): the Python module doesn't exist on Windows and the test imports it inside the function body, so on Windows the test crashes with `ModuleNotFoundError: No module named 'fcntl'` at collect time. The fix it pins (LOCK_SH + LOCK_NB coexistence on the same file) is meaningful only on POSIX. - `test_server_sigterm.py::test_legacy_lock_sh_allows_multiple_holders` Signal / SIGKILL escalation (4 tests): the production path in `upgrade_cmd` already takes a Windows-specific branch ("Detected Windows; skipping process termination") that is fully covered by `test_windows_skips_kill` (which we leave running on Windows). The SIGTERM/SIGKILL escalation tests assert on POSIX-only output strings and signal sequences and fail otherwise. Skipping them does NOT lose Windows coverage of the upgrade flow — `test_windows_skips_kill` keeps running. - `test_upgrade_cmd.py::test_no_running_server_just_reinstalls` - `test_upgrade_cmd.py::test_running_server_sigterm_path` - `test_upgrade_cmd.py::test_running_server_escalates_to_sigkill` - `test_upgrade_cmd.py::test_pid_file_unlink_skipped_if_respawned` Out of scope (other Windows CI failure classes — separate PRs): - `test_uninstall_cmd.py` failures: NOT POSIX-only mode bits — they surface NTFS file-locking semantics (.db / .db-shm / .db-wal aren't deleted while open, lock detection, inventory text differences). Multi-factor; deferred to PR 4/5. - HOME monkeypatch reach (`Path.home()` vs `USERPROFILE`) — issue #644 - Path canonicalization in indexing — issue #647 - Symlink + git-status detection (flaky class) - `'home'` fs alias / tilde expansion — issue #646 - `config_signature` NTFS mtime resolution — issue #645 - Wizard auto-detect Claude/Codex memory dirs — issue #316 Verification: - `uv run pytest` on the 5 touched files (macOS): 91 passed. - `uv run ruff check + format --check` clean. - Windows CI before/after counts to be appended to the PR body once the branch run finishes; expected reduction is ~9 (all 9 targeted tests show up as SKIPPED on Windows, FAIL count drops accordingly). Refs #637 (file-mode class umbrella; this PR doesn't touch the XDG_RUNTIME_DIR tests #637 was originally written for, so leaving it open). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Owner
Author
Windows CI delta (run 25245004184, job 74027634112)
What actually changedAll 9 POSIX-only tests this PR targets are gone from the failure list ✅:
The net is −8 (not −9) because the symlink / git-status failure class is flaky on Windows — same flake noise PR #711 saw. 2 tests from that class disappeared between runs ( Cumulative roadmap progress
Negative pin (no regression on other OSes)
✅ All required gates green; the Windows job is informational ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of N in the Windows-CI green-up roadmap. (PR 1 was #711.)
Summary
Adds
@pytest.mark.skipif(sys.platform == "win32", reason="…")to 9 tests across 5 files that exercise features which either don't exist on Windows or take a deliberately-different code path that's already covered by an existingtest_windows_skips_kill-style sibling. Single uniform change axis — no assertion logic touched, no production source modified.Cross-check table
Triaged against the latest Windows fail log (
gh run view 25244446944 --log-failed --job=74026052967, 113 failures total).test_context_atomic.py::test_atomic_write_explicit_mode_0o600stat.S_IMODEtest_context_atomic.py::test_atomic_write_respects_custom_modetest_context_install.py::test_install_files_written_with_default_modetest_context_settings.py::TestClaudeSettingsAtomicWrite::test_mode_is_0o600test_server_sigterm.py::test_legacy_lock_sh_allows_multiple_holdersModuleNotFoundError: No module named 'fcntl'at body-import timetest_upgrade_cmd.py::test_no_running_server_just_reinstallstest_windows_skips_kill)test_upgrade_cmd.py::test_running_server_sigterm_pathtest_upgrade_cmd.py::test_running_server_escalates_to_sigkilltest_upgrade_cmd.py::test_pid_file_unlink_skipped_if_respawnedNo Windows coverage is lost for the upgrade flow —
test_windows_skips_kill(line 124 oftest_upgrade_cmd.py) explicitly tests the Windows branch and continues to run.Why skipif and not test rewrite
For the file-mode and
fcntltests, the property under test is meaningful only on POSIX. NTFS doesn't honourstat.S_IMODEand Python on Windows doesn't shipfcntl— there is nothing equivalent to assert.For the four
test_upgrade_cmd.pytests, the production code already has a Windows-aware branch (upgrade_cmd.py:256—sys.platform == "win32"guard) and the existingtest_windows_skips_killalready pins that branch's behaviour. Asserting a SIGTERM-shaped output on Windows would just duplicate the redirect that Windows test already covers.Verification
uv run pyteston the 5 touched files (macOS): 91 passed.uv run ruff check + format --checkclean on the same files.Windows CI impact
Measured on this branch's run (
gh run view 25245004184 --log-failed --job=74027634112).The net (−8) understates the POSIX-skipif contribution (−9) because the symlink / git-status failure class is flaky on Windows — same flake noise the PR #711 run also hit. Two more tests from that class disappeared between runs (
test_cli_status_renders_states,test_dirty_partial_subdir) and three new ones appeared (test_stale_pin_when_history_rewritten,test_clean_immediately_after_install,test_skip_symlinks) — all in the same flaky class, none caused by this PR. They will be addressed in the dedicated symlink/git-status follow-up PR.macOS / Ubuntu / lint / typecheck / golden-path / notebooks / CLA all green on this branch.
Out of scope (separate follow-up PRs)
Path.home()usesUSERPROFILEon Windows) — issue Windows: HOME monkeypatch doesn't reachPath.home()on Windows (uses USERPROFILE) #644kinddetection + memory_dir comparisons #647'home'fs alias / tilde expansion — issue Windows:'home'fs alias + tilde expansion in web fs-list endpoint #646config_signatureNTFS mtime resolution — issue Windows: config_signature unchanged after write — NTFS mtime resolution / cache #645test_uninstall_cmd.pyfailures: surface NTFS file-locking semantics (.db/.db-shm/.db-walopen-file-handle deletes, lock detection, inventory text differences). Multi-factor; needs investigation, not a blanket skipif. Deferred.Refs #637 (file-mode class umbrella). This PR doesn't touch the XDG_RUNTIME_DIR tests that #637 was originally written for, so leaving #637 open.
Test plan
🤖 Generated with Claude Code