Skip to content

[Client] Keep the listening stream tests from blocking on macOS - #760

Open
andre-schade wants to merge 1 commit into
modelcontextprotocol:mainfrom
andre-schade:fix/listen-test-socket-buffer
Open

andre-schade wants to merge 1 commit into
modelcontextprotocol:mainfrom
andre-schade:fix/listen-test-socket-buffer

Conversation

@andre-schade

Copy link
Copy Markdown

On macOS, make tests hangs in HttpTransportListenTest: testEventLargerThanOneReadIsHandledWithinOneCall and testListenStreamReadIsBoundedPerCall write 20 KB and 90 KB to the server end of the socket pair before the client reads anything. A Unix stream_socket_pair() buffers only 8 KB on macOS (Linux buffers far more, so CI is green), so the blocking fwrite() never returns.

The test helper now creates the pair with ext-sockets when it is loaded and raises SO_SNDBUF/SO_RCVBUF to 1 MiB. Without ext-sockets, and on Windows, it falls back to stream_socket_pair() as before. With this, tests/Unit/Client passes on macOS (PHP 8.5): 1435 tests.

Test-only change.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
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