fix(tests): consume the request body in the proxy stub before replying - #91
Open
maxlamagna wants to merge 1 commit into
Open
fix(tests): consume the request body in the proxy stub before replying#91maxlamagna wants to merge 1 commit into
maxlamagna wants to merge 1 commit into
Conversation
ProxyHeaderForwardingTests' stub replies to a POST without reading the request body. Closing a socket that still holds unread data makes the OS send RST rather than a clean FIN, and RST tells the peer's kernel to discard what it has already buffered for that socket - including the response the client received but had not yet read. mcp_proxy then correctly surfaces the dead connection as a 502, so the test fails while the product code is behaving properly. It is load-sensitive, which is why the same commit can pass one run and fail the next. The sibling stub in this class only implements do_GET, which carries no request body and so cannot hit this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #89.
ProxyHeaderForwardingTests' stub server replies to a POST without reading the request body. Closing a socket that still holds unread data can make the OS send RST rather than a clean FIN, and an RST can cause the peer's kernel to discard what it has already buffered for that socket — including the response the client received but had not yet read.mcp_proxythen correctly surfaces the dead connection as a 502, so the test fails while the product code is behaving properly.It is load-sensitive, which is why the same commit can pass one run and fail the next.
Test-only: no product code, no live server, no credentials, no user data.
The sibling stub in the same class implements only
do_GET, which carries no request body, so it cannot hit this and is left alone.Locally, running that file 15 times went from 6 failures to 0. Load was not held constant between the two runs, so that number is indicative; the mechanism in #89 is the substantive claim.
This is the first of several small changes we would like to offer, and it is deliberately first: until it lands, a full-suite run on any of the others has a chance of failing for reasons unrelated to the change under review. The rest are #67 (concurrent per-project wrapper sessions) and the three-PR stack described in #90.