fix: resolve 15 test failures on Windows platform#300
Open
rubuslab wants to merge 1 commit into
Open
Conversation
Fixes test suite failures when running on Windows (win32) due to
platform-specific behaviors not being properly handled.
Source code fixes:
- src/openharness/swarm/team_lifecycle.py: Use Path.replace() instead of
Path.rename() for atomic file writes, as rename() raises FileExistsError
on Windows when the target already exists
- src/openharness/autopilot/service.py: Use posix=False for shlex.split()
on Windows to handle backslash paths correctly
- src/openharness/ui/input.py: Lazily initialize PromptSession to avoid
NoConsoleScreenBufferError when no Windows console is attached
- pyproject.toml: Add tzdata dependency for timezone support on Windows
(where system timezone data is not available to Python's zoneinfo)
Test fixes:
- tests/test_ohmo/test_gateway.py: Mock Windows-specific process
management (wmic + taskkill) instead of POSIX-only (ps + os.kill);
replace deprecated datetime.utcnow() with datetime.now(UTC)
- tests/test_swarm/test_lockfile.py: Skip POSIX-only fcntl test on Windows
- tests/test_swarm/test_registry.py: Use explicit InProcessBackend
registration instead of monkeypatch to avoid module cache invalidation
from test_imports.py
- tests/test_tools/test_bash_tool.py: Use monkeypatch.setitem on
function globals to correctly mock imported create_shell_subprocess
- tests/test_utils/test_shell.py: Mock get_platform() to ensure
consistent shell binary expectations across platforms
Author
Author
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.


Fixes test suite failures when running on Windows (win32) due to
platform-specific behaviors not being properly handled.
Source code fixes:
Test fixes:
Summary
Validation
uv run ruff check src tests scriptsuv run pytest -qcd frontend/terminal && npx tsc --noEmit(if frontend touched)Notes