Skip to content

Commit 54dadc3

Browse files
committed
fix(tests): session_queue ~/state test sets USERPROFILE next to HOME (#692, class 5)
Run 38008915302 (windows-latest, Suite) failed test_root_and_job_paths_preserve_intake_context[~/state] in tests_py/hooks/test_session_queue.py. The test set HOME only; on Windows Path.expanduser reads USERPROFILE (ntpath, Python >= 3.8) and falls back to HOMEDRIVE+HOMEPATH, so "~/state" resolved under the runner's profile, not tmp_path. Test defect, not a product one: session_queue.queue_root expands "~" the platform's way. Refs #692 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018kyZYsqjqvVrsjKfbTBS2U
1 parent 8b22316 commit 54dadc3

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ adheres to [Semantic Versioning](https://semver.org/).
130130

131131
### Fixed
132132

133+
- `test_root_and_job_paths_preserve_intake_context[~/state]` sets `USERPROFILE`
134+
next to `HOME` (#692 class 5, 1 Windows failure in run 38008915302).
135+
`Path.expanduser` reads `USERPROFILE` on Windows and ignores `HOME`, so
136+
`~/state` resolved under the runner's real profile instead of the test root.
133137
- Four `validate_memory` tests write their file references the way the
134138
platform writes paths (#692 class 5, 4 Windows failures in run 38008915302).
135139
`f"{tmp_path}/a.py"` mixes `\` and `/` on Windows, and the extractor reads

‎tests_py/hooks/test_session_queue.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,10 @@ def test_busy_job_does_not_block_another_session(queue):
204204
def test_root_and_job_paths_preserve_intake_context(
205205
queue, tmp_path, monkeypatch, configured
206206
):
207+
# Path.expanduser reads HOME on POSIX and USERPROFILE on Windows (ntpath,
208+
# Python >= 3.8): with HOME alone, "~/state" left the test root (#692).
207209
monkeypatch.setenv("HOME", str(tmp_path))
210+
monkeypatch.setenv("USERPROFILE", str(tmp_path))
208211
monkeypatch.chdir(tmp_path)
209212
monkeypatch.setenv("CORTEX_CLAUDE_DIR", configured)
210213
monkeypatch.setenv("CORTEX_MEMORY_SQLITE_FALLBACK_PATH", "relative.db")

0 commit comments

Comments
 (0)