pytest: update two H3 tests for nghttp3 1.18.0+

Fixing:
```
FAILED ../../tests/http/test_02_download.py::TestDownload::test_02_36_looong_urls[65536-h3] -
  AssertionError: expected exit code 0, got 56
FAILED ../../tests/http/test_14_auth.py::TestAuth::test_14_05_basic_large_pw[h3] -
  AssertionError: expected exit code 0, got 56
```
Ref: https://github.com/curl/curl/actions/runs/30207198835/job/89807247058?pr=22400

Refs:
https://github.com/ngtcp2/nghttp3/pull/539
a587264544

Bug: https://github.com/curl/curl/pull/22397#issuecomment-5084927935

Closes #22402
This commit is contained in:
Viktor Szakats 2026-07-26 21:15:33 +02:00
parent e90c4397c8
commit f9dc57a149
No known key found for this signature in database
2 changed files with 16 additions and 10 deletions

View file

@ -720,11 +720,11 @@ class TestDownload:
# h2 is unable to send such large headers (frame limits)
r.check_exit_code(55)
elif proto == 'h3':
if url_junk <= 64 * 1024:
r.check_exit_code(0)
# nghttpx reports 431 Request Header Field too Large
# nghttpx reports 431 Request Header Field too Large
# or destroys the connection with internal error
# ERR_QPACK_HEADER_TOO_LARGE,
# depending on nghttp3 version and payload size
assert r.exit_code in (0, 56), f'expected exit code 0 or 56, '\
f'got {r.exit_code}\n{r.dump_logs()}'
if r.exit_code == 0:
r.check_response(http_status=431)
else:
# nghttpx destroys the connection with internal error
# ERR_QPACK_HEADER_TOO_LARGE
r.check_exit_code(56)

View file

@ -92,7 +92,7 @@ class TestAuth:
# PUT data, basic auth large pw
@pytest.mark.parametrize("proto", Env.http_mplx_protos())
def test_14_05_basic_large_pw(self, env: Env, httpd, nghttpx, proto):
if proto == 'h3' and not env.curl_uses_lib('ngtcp2'):
if proto == 'h3' and env.curl_uses_lib('quiche'):
# See <https://github.com/cloudflare/quiche/issues/1573>
pytest.skip("quiche has problems with large requests")
# large enough that nghttp2 will submit
@ -105,8 +105,14 @@ class TestAuth:
'--trace-config', 'http/2,http/3'
])
# but apache either denies on length limit or gives a 400
r.check_exit_code(0)
assert r.stats[0]['http_code'] in [400, 431]
if proto == 'h3':
# depends on nghttp3 version
assert r.exit_code in (0, 56), f'expected exit code 0 or 56, '\
f'got {r.exit_code}\n{r.dump_logs()}'
else:
r.check_exit_code(0)
if r.exit_code == 0:
assert r.stats[0]['http_code'] in [400, 431]
# PUT data, basic auth with very large pw
@pytest.mark.parametrize("proto", Env.http_mplx_protos())