Skip to content

wptserve H2 tests flakily failing #51981

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

Open
gsnedders opened this issue Apr 14, 2025 · 1 comment
Open

wptserve H2 tests flakily failing #51981

gsnedders opened this issue Apr 14, 2025 · 1 comment

Comments

@gsnedders
Copy link
Member

I've seen this a few times recently; see e.g. this Azure Pipelines step. (Logs attached here for archival reasons: 209.txt.)

That job had:

FAILED wptserve/tests/functional/test_response.py::TestH2Response::test_raw_data_frame
FAILED wptserve/tests/functional/test_server.py::TestFileHandlerH2::test_not_handled
FAILED wptserve/tests/functional/test_server.py::TestRewriterH2::test_rewrite
FAILED wptserve/tests/functional/test_server.py::TestRequestHandlerH2::test_exception

They all failed with:

httpx.ReadTimeout: The read operation timed out

And had captured logs like:

----------------------------- Captured log setup ------------------------------
INFO     root:server.py:867 Starting http2 server on https://localhost:51070/
---------------------------- Captured log teardown ----------------------------
ERROR    root:server.py:426 (923a45a7) Closing Connection - 
[WinError 10054] An existing connection was forcibly closed by the remote host
INFO     root:server.py:885 Stopped http server on localhost:51070

Pretty sure I've also seen this on not-Windows too.

@Denis793
Copy link

Hello!
I think this timeout issue could be caused by the server not being fully ready or network delays during the test.
Possible solutions:

Increase the timeout settings in the httpx client during tests.

Add retries for requests that fail with ReadTimeout.

Insert a short sleep/delay after starting the server and before running tests.

I can try to help if you'd like me to suggest a concrete fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants