Fix cross-platform model_path assertion in FSDP config worker dict test#107
Open
dipeshbabu wants to merge 7 commits intoagentscope-ai:mainfrom
Open
Fix cross-platform model_path assertion in FSDP config worker dict test#107dipeshbabu wants to merge 7 commits intoagentscope-ai:mainfrom
dipeshbabu wants to merge 7 commits intoagentscope-ai:mainfrom
Conversation
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.
Summary
This fixes a cross-platform test failure in
test_config_to_worker_dict.The test previously asserted that
d["model_path"] == "/tmp/model", which works on macOS/Linux but fails on Windows becausePath("/tmp/model")is stringified using platform-specific path semantics. On Windows,str(Path("/tmp/model"))does not match the hardcoded POSIX path string.What changed
Updated the assertion to compare against the actual serialized value derived from the config object:
assert d["model_path"] == "/tmp/model"assert d["model_path"] == str(config.model_path)Why this is correct
_config_to_worker_dict()is serializing a filesystem path from aPathobject. The string representation ofPathis platform-dependent, so the test should validate againststr(config.model_path)rather than a Unix-only literal.This keeps the implementation unchanged and makes the test valid on Windows, macOS, and Linux.
Scope
Test-only change. No runtime behavior changed.
Validation
Ran:
uv run pytest ...uv run ruff check .This resolves the Windows-specific failure while preserving the intended behavior of
_config_to_worker_dict().