-
Notifications
You must be signed in to change notification settings - Fork 2k
#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
#552 #707
Conversation
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]>
…ptions Signed-off-by: DanielAvdar <[email protected]>
The test |
…d exceptions Signed-off-by: DanielAvdar <[email protected]>
Signed-off-by: DanielAvdar <[email protected]>
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]>
Signed-off-by: DanielAvdar <[email protected]>
There was a problem hiding this 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
Dismissing review as I've applied fixes on tops of this branch - thanks @DanielAvdar for your contribution!
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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.