Skip to content

Fix Windows baseline test compatibility#401

Merged
warren618 merged 4 commits into
HKUDS:mainfrom
Elfsa-Miranda:fix/windows-baseline-tests
Jul 5, 2026
Merged

Fix Windows baseline test compatibility#401
warren618 merged 4 commits into
HKUDS:mainfrom
Elfsa-Miranda:fix/windows-baseline-tests

Conversation

@Elfsa-Miranda

Copy link
Copy Markdown
Contributor

Summary

This PR fixes Windows baseline test compatibility issues without changing live trading, broker, scheduler, shell-tool, or remote API behavior.

The original Windows baseline failed in four concentrated areas:

  • Loader cache tests leaked into the real Windows user cache directory because the tests patched HOME, while Windows home resolution can still use USERPROFILE.
  • OAuth token cache tests asserted POSIX-style 0700 permissions, which are not directly round-trippable on Windows ACL-based filesystems.
  • One parallel bench mock test depended on fork-style inheritance of monkeypatched registry state, which does not hold under Windows multiprocessing spawn.
  • MCP SSE / streamable HTTP integration tests failed because loopback requests were routed through the local proxy, causing 502 Bad Gateway responses.

Changes

  • Added an explicit loader cache root override for tests while preserving the production default cache path.

  • Made OAuth token cache permission assertions platform-aware:

    • POSIX still checks 0700.
    • Windows checks creation, isolation, idempotence, and non-leakage without asserting POSIX mode equivalence.
  • Skipped the fork-dependent parallel bench mock test on Windows only.

  • Updated MCP loopback fixture setup so local 127.0.0.1 / localhost traffic bypasses environment proxies during the fixture lifecycle.

Validation

Validated on Windows PowerShell with Python 3.12.12 in an isolated virtual environment.

Targeted tests:

agent/tests/test_loader_retry_helpers.py: 20 passed
agent/tests/test_oauth_token_cache.py: 11 passed
agent/tests/test_bench_parallel.py: 7 passed, 1 skipped
MCP SSE / streamable HTTP integration: 7 passed

Full baseline:

pytest --ignore=agent/tests/e2e_backtest -q --tb=short
4701 passed, 6 skipped, 19 warnings in 173.50s

CLI check:

vibe-trading --help
exit code 0

Safety Notes

This PR does not:

  • Start serve
  • Start scheduler
  • Connect to a real broker
  • Enable live trading
  • Enable VIBE_TRADING_ENABLE_SHELL_TOOLS
  • Commit agent/.env
  • Write real keys, tokens, or credentials into tests or logs

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.

2 participants