fix(tests): use native_io_path for pending attachment reads on Windows - #1522
Open
QinLuza wants to merge 1 commit into
Open
fix(tests): use native_io_path for pending attachment reads on Windows#1522QinLuza wants to merge 1 commit into
QinLuza wants to merge 1 commit into
Conversation
Three pending-attachment RPC tests failed on Windows with FileNotFoundError even though the material file existed on disk. The staged owner paths are ~297 chars (two 64-hex digest segments in the tree), past MAX_PATH: the production writer goes through native_io_path (extended-length \\?\ prefix) and succeeds, but the test assertions read the bare pathlib object, which the Win32 layer refuses. Verified on a live failing run: Test-Path on the bare path returned False while the same path with the \\?\ prefix returned True. Switch the four affected assertions to native_io_path(...), matching the convention paths.py documents for filesystem boundaries. No product code change.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Three pending-attachment RPC tests in
tests/test_gateway/test_turn_ingress_rpc.pyfail on Windows withFileNotFoundErroreven though the material file exists on disk:test_pending_attachment_survives_restart_dispatches_once_and_cleans_ownertest_pending_attachment_cancel_removes_only_its_private_ownertest_session_delete_reclaims_pending_attachment_ownerThe staged owner paths are ~297 characters (
media/transcripts/<session-uuid>/.pending-chat-inputs/<64-hex owner digest>/<64-hex content sha>), pastMAX_PATH(260). The production writer goes throughnative_io_path()(extended-length\\?\prefix) and succeeds, but the test assertions read the bare pathlib object, which the Win32 layer refuses — so the assert sees "no such file" while the file is actually there.Live reproduction confirmed this:
Test-Pathon the bare path returnedFalsewhile the same path with the\\?\prefix returnedTrue. The DB-level assertions (which never touch disk) pass; only the bareread_bytes()asserts fail.Fix
Route the four affected test assertions through
native_io_path(), matching the convention documented inpaths.py("use this value only at the filesystem or SQLite boundary"). No product code changes.Verification
mainin an isolated worktree, unrelated to any in-flight PR.