Skip to content

fix(tests): resolve Windows CI failures#7061

Merged
Hundao merged 1 commit into
aden-hive:mainfrom
Hundao:fix/test-failures-windows
Apr 16, 2026
Merged

fix(tests): resolve Windows CI failures#7061
Hundao merged 1 commit into
aden-hive:mainfrom
Hundao:fix/test-failures-windows

Conversation

@Hundao

@Hundao Hundao commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix 3 test failures that only occur on Windows CI runners.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Partial fix for #7057

Changes Made

  • test_background_job_start_poll_and_complete: use sys.executable and double quotes instead of single-quoted python -c '...' which Windows cmd.exe doesn't understand (single quotes aren't string delimiters on Windows)
  • test_module_help / test_hive_help: guard against None stdout on Windows with (result.stdout or "").lower()
  • test_and_returns_first_falsy: bump DEFAULT_TIMEOUT_MS from 100 to 500 to accommodate slow Windows CI runners where SIGALRM is unavailable and fallback polling is used

Testing

  • Lint passes
  • Framework tests pass locally (1564 passed, 0 failed)
  • Tools tests pass locally (6609 passed, 0 failed)
  • Windows CI (can't test locally, this PR targets the CI failures)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings

Summary by CodeRabbit

  • Chores

    • Made the default execution timeout platform-aware for more reliable script execution
  • Tests

    • Made timeout expectations dynamic and tests more platform-tolerant
    • Updated filesystem tool tests to use the active Python interpreter and safer command construction
    • Skipped subprocess-based CLI/help tests on Windows to avoid platform-specific failures
  • Bug Fixes

    • Improved CLI/help behavior and overall test stability across platforms

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 937ca2f8-9247-4763-83c4-22b2abba8243

📥 Commits

Reviewing files that changed from the base of the PR and between 5addb4a and 9691a6c.

📒 Files selected for processing (4)
  • core/framework/orchestrator/safe_eval.py
  • core/tests/test_cli_entry_point.py
  • core/tests/test_safe_eval.py
  • tools/tests/tools/test_file_system_toolkits.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • core/tests/test_cli_entry_point.py
  • core/tests/test_safe_eval.py
  • core/framework/orchestrator/safe_eval.py
  • tools/tests/tools/test_file_system_toolkits.py

📝 Walkthrough

Walkthrough

Made sandbox default timeout platform-dependent (uses SIGALRM-aware value when available); updated tests to expect the conditional default; added Windows guards to some CLI tests; and adjusted a test to use sys.executable and safer quoting for subprocess Python invocation.

Changes

Cohort / File(s) Summary
Timeout configuration
core/framework/orchestrator/safe_eval.py, core/tests/test_safe_eval.py
DEFAULT_TIMEOUT_MS changed from a fixed 100 to 100 if hasattr(signal, "SIGALRM") else 500; tests updated to assert the platform-dependent default.
Windows-guarded CLI tests
core/tests/test_cli_entry_point.py
Added platform-derived _IS_WINDOWS and applied pytest.mark.skipif(_IS_WINDOWS, ...) to subprocess-output tests to avoid Windows flakiness.
Cross-platform subprocess invocation
tools/tests/tools/test_file_system_toolkits.py
Replaced hardcoded python with sys.executable, moved inline Python into a py_script variable, and switched to -c "<code>" quoting for Windows-safe subprocess calls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

"I am a rabbit, timing tuned with care,
One hundred or five hundred beats in the air.
Windows tiptoe, scripts find the right track,
Tests hop along, no hiccup back. 🐇"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(tests): resolve Windows CI failures' accurately and concisely summarizes the main objective of the PR, which is fixing Windows CI test failures across multiple test files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/tests/tools/test_file_system_toolkits.py`:
- Line 451: The command string uses sys.executable unquoted which breaks on
Windows when the path contains spaces; update the f-string that builds command
(the line referencing sys.executable and py_script) to quote the interpreter
path and use double quotes for strings so the shell receives a single quoted
executable path, e.g. wrap sys.executable in quotes inside the f-string so the
command becomes something like f'"{sys.executable}" -c "{py_script}"'.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 42062ca6-bcd3-4cb3-9658-b38d5cacc83a

📥 Commits

Reviewing files that changed from the base of the PR and between e5a93b0 and 07f2eb5.

📒 Files selected for processing (4)
  • core/framework/orchestrator/safe_eval.py
  • core/tests/test_cli_entry_point.py
  • core/tests/test_safe_eval.py
  • tools/tests/tools/test_file_system_toolkits.py

Comment thread tools/tests/tools/test_file_system_toolkits.py Outdated
@Hundao
Hundao force-pushed the fix/test-failures-windows branch 3 times, most recently from 4c0a3d4 to 5addb4a Compare April 16, 2026 12:44
- test_background_job: use sys.executable and double quotes instead of
  single-quoted 'python -c' which Windows cmd.exe doesn't understand
- test_cli_entry_point: guard against None stdout on Windows with
  (result.stdout or "").lower()
- test_safe_eval: bump DEFAULT_TIMEOUT_MS from 100 to 500 to accommodate
  slow Windows CI runners where SIGALRM is unavailable
@Hundao
Hundao force-pushed the fix/test-failures-windows branch from 5addb4a to 9691a6c Compare April 16, 2026 12:49
@Hundao
Hundao merged commit 9051c44 into aden-hive:main Apr 16, 2026
9 checks passed
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