From 14478429e71ef0eee6d12b73113e9ff8e3ae9e75 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Wed, 10 Dec 2025 11:17:49 +0100 Subject: [PATCH] pytest: quiche flakiness Let nghttpx only use http/1.1 to backend. This reproduces the bug in quiche with higher frequency. Allow test_14_05 to now return a 400 in addition to the 431 we get from a h2 backend to nghttpx. Skip test_05_02 in h3 on quiche not newer than version 0.24.4 in which its bug is fixed: https://github.com/cloudflare/quiche/pull/2278 Ref: https://github.com/cloudflare/quiche/issues/2277 Closes #19770 (original Issue) Closes #19916 --- tests/http/test_05_errors.py | 3 +++ tests/http/test_14_auth.py | 5 +++-- tests/http/testenv/nghttpx.py | 1 - 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/http/test_05_errors.py b/tests/http/test_05_errors.py index 102b92e202..5fada15005 100644 --- a/tests/http/test_05_errors.py +++ b/tests/http/test_05_errors.py @@ -60,6 +60,9 @@ class TestErrors: def test_05_02_partial_20(self, env: Env, httpd, nghttpx, proto): if proto == 'h3' and env.curl_uses_ossl_quic(): pytest.skip("openssl-quic is flaky in yielding proper error codes") + if proto == 'h3' and env.curl_uses_lib('quiche') and \ + not env.curl_lib_version_at_least('quiche', '0.24.5'): + pytest.skip("quiche issue #2277 not fixed") count = 20 curl = CurlClient(env=env) urln = f'https://{env.authority_for(env.domain1, proto)}' \ diff --git a/tests/http/test_14_auth.py b/tests/http/test_14_auth.py index 0187c76a6a..9f2ae7a27f 100644 --- a/tests/http/test_14_auth.py +++ b/tests/http/test_14_auth.py @@ -107,8 +107,9 @@ class TestAuth: '--basic', '--user', f'test:{password}', '--trace-config', 'http/2,http/3' ]) - # but apache denies on length limit - r.check_response(http_status=431) + # 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] # PUT data, basic auth with very large pw @pytest.mark.parametrize("proto", Env.http_mplx_protos()) diff --git a/tests/http/testenv/nghttpx.py b/tests/http/testenv/nghttpx.py index 106766fc0f..950d567f24 100644 --- a/tests/http/testenv/nghttpx.py +++ b/tests/http/testenv/nghttpx.py @@ -247,7 +247,6 @@ class NghttpxQuic(Nghttpx): '--frontend-quic-early-data', ]) args.extend([ - f'--backend=127.0.0.1,{self.env.https_port};{self._domain};sni={self._domain};proto=h2;tls', f'--backend=127.0.0.1,{self.env.http_port}', '--log-level=ERROR', f'--pid-file={self._pid_file}', -- 2.47.3