Skip to content

#552 #707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 8, 2025
Merged

#552 #707

merged 15 commits into from
Jul 8, 2025

Conversation

DanielAvdar
Copy link
Contributor

This pull request adds a new test to verify the fix for a Windows-specific process creation issue described in issue #552. The test ensures that the process creation function works without hanging.

Added test for Windows process creation:

  • tests/issues/test_552_windows_hang.py: Introduced a new test, test_windows_process_creation, to validate the functionality of _create_platform_compatible_process on Windows. The test uses a simple command (cmd /c echo Test successful) and sets a timeout to prevent hanging. It verifies that the process is created successfully and produces output.

@ihrpr ihrpr added this to the HPR milestone May 13, 2025
Refactored test to utilize `stdio_client` for more accurate simulation of the fixed behavior and added handling for proper initialization with `ClientSession`. Increased timeout to 10 seconds to prevent premature failures and ensured hanging issue is properly caught and reported.

Signed-off-by: DanielAvdar <[email protected]>
@DanielAvdar
Copy link
Contributor Author

DanielAvdar commented May 14, 2025

The test tests/issues/test_552_windows_hang.py is currently marked as xfail for hanging processes, which is the expected behavior. It will pass once the issue causing the hang is resolved.
@ihrpr

@DanielAvdar DanielAvdar marked this pull request as ready for review May 14, 2025 15:50
Updated the Windows-specific test to use `@pytest.mark.parametrize` for varied command arguments. This change improves test coverage and simplifies the testing of process creation scenarios.

Signed-off-by: DanielAvdar <[email protected]>
Copy link
Contributor

@felixweinberger felixweinberger left a comment

Choose a reason for hiding this comment

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

Thank you @DanielAvdar for submitting this PR and helping us improve our test coverage!

I've left some comments on the PR - please address these and I'm happy to review quickly so we can get this landed.

- Replace asyncio.timeout with anyio.fail_after for consistency
- Simplify exception handling
- Uncomment Windows-specific test skip condition
- Rewrite tests to focus on verifying no hang occurs (issue modelcontextprotocol#552)
- Use simple Python subprocesses that exit quickly
- Remove complex assertions - test passes if it completes without timeout
@felixweinberger felixweinberger dismissed their stale review July 8, 2025 16:21

Dismissing review as I've applied fixes on tops of this branch - thanks @DanielAvdar for your contribution!

@felixweinberger felixweinberger requested a review from ihrpr July 8, 2025 16:23
@felixweinberger
Copy link
Contributor

Addressed comments + reformated the test to be a true regression test such that it would fail without the fix (previous format was causing xfail if not hanging which is counterintuitive).

Copy link
Contributor

@ihrpr ihrpr left a comment

Choose a reason for hiding this comment

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

Thank you!

@ihrpr ihrpr merged commit b16c2a8 into modelcontextprotocol:main Jul 8, 2025
20 of 21 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.

3 participants