fix: Replace remaining manual server polling with wait_for_server helper #1529
  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.
  
    
  
    
This PR completes the work started in #1527 by fixing the remaining test fixtures that were still using manual socket polling loops to wait for server startup.
Motivation and Context
PR #1527 introduced the
wait_for_server()helper and fixed most test files, but missed 4 test fixtures that were still using manual polling loops with arbitrarytime.sleep()calls. These remaining fixtures could still cause flaky test failures in CI due to race conditions.Changes Made
Fixed 4 test fixtures that still used manual polling:
server_transportfixturenon_sdk_serverfixturerunning_unicode_serverfixturemounted_serverandcontext_serverfixturesBefore (Manual Polling):
After (Active Polling):
How Has This Been Tested?
All modified test files have been verified:
pytest tests/server/fastmcp/test_integration.py- 20 tests passpytest tests/client/test_notification_response.py- 1 test passespytest tests/client/test_http_unicode.py- 2 tests passpytest tests/shared/test_sse.py::test_sse_client_basic_connection_mounted_app- 1 test passesBreaking Changes
None - this is purely an internal test infrastructure improvement.
Types of changes
Checklist
Additional context
This change:
All server startup waiting uses the centralized
wait_for_server()helper.