Skip to content

Fix cross-platform model_path assertion in FSDP config worker dict test#107

Open
dipeshbabu wants to merge 7 commits intoagentscope-ai:mainfrom
dipeshbabu:fix/fsdp-config-path-test-windows
Open

Fix cross-platform model_path assertion in FSDP config worker dict test#107
dipeshbabu wants to merge 7 commits intoagentscope-ai:mainfrom
dipeshbabu:fix/fsdp-config-path-test-windows

Conversation

@dipeshbabu
Copy link
Copy Markdown
Contributor

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 because Path("/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:

  • before: assert d["model_path"] == "/tmp/model"
  • after: assert d["model_path"] == str(config.model_path)

Why this is correct

_config_to_worker_dict() is serializing a filesystem path from a Path object. The string representation of Path is platform-dependent, so the test should validate against str(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().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant