requests-unixsocket
requests-unixsocket copied to clipboard
testutils: fix test flake on HEAD request
testutils: fix test flake on HEAD request
Flakiness may be observed when running the unit tests. The symptom of that looks like: requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine('Hello world!HTTP/1.1 200 OK\r\n'))
We believe that, with the correct send and recv timing, the "Hello world!" body from a HEAD request will be left unread in the reused socket, resulting in an invalid read for the next request along.
Co-authored-by: Olivier Gayot [email protected]
Testing was performed with 39b9c64847a52ddc8c6d14ff414a6a7a3f6358d9 cherry-picked to the branch but is otherwise independent of that change.