-
Notifications
You must be signed in to change notification settings - Fork 44
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
Properly handle requests that do multiple writes (e.g. by aiohttp 3) #66
Comments
Thank you very much for the contribution. I'll have a look at that as soon as possible. |
Hi @sjaensch, I did |
@mindflayer Mocket is enabled with this fixture: https://github.com/sjaensch/aiobravado/blob/dfacf2655053f765d832f50adff4659a79a3063d/tests/functional/conftest.py#L74 There are several other tests that use Mocket and continue to pass. Note that the two tests in question also pass if you use aiohttp<3.0. The fact that Mocket tests pass with aiohttp 3.0.2 tells me that this case is not covered by your tests. :) All of your aiohttp tests do simple GET requests. Make sure you do a request that contains a body, so typically a POST request with some data. The aiobravado tests that do GET requests are still passing as well with aiohttp 3.0. As I explained in the description, aiohttp 3 does two network writes: One for the request headers, one for the request body. GET requests usually do not have a request body. |
Hi @sjaensch, could you try to run your tests using this branch (https://github.com/mindflayer/python-mocket/tree/body-via-send)? |
@mindflayer awesome! Both tests pass if I use that branch, well done! |
I've seen you have another failing test apparently related to |
Here you are: https://pypi.python.org/pypi/mocket/2.2.0 |
The aiohttp client in version 3 does (at least) two writes if the request has a body: one for the headers, a second for the body. This was done in aio-libs/aiohttp#2126 and is documented in the "Are there changes in behavior for the user?" section of the description. Check out the diff of the write_headers function.
With mocket, this is not handled correctly. The body is lost. Would it be possible to implement proper handling of this scenario?
Example test failures: https://travis-ci.org/sjaensch/aiobravado/jobs/343058521
Test 1 source
Test 2 source
The text was updated successfully, but these errors were encountered: