]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test07_22: fix flakiness
authorStefan Eissing <stefan@eissing.org>
Fri, 14 Nov 2025 15:26:14 +0000 (16:26 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 Nov 2025 16:06:23 +0000 (17:06 +0100)
The HTTP/3 tests did send 20 transfers against nghttpx with a backend
that failed the uploads with a 400 and an incomplete response body. This
causes stream resets.

Apache keeps the connection open, but newer nghttpx closes the front
connection after "too many" reset. When that bites, it depends on the
number of transfers ongoing how the test case fails. This led to flaky
outcomes.

Reduce the transfers to just a single one and check the result of
that one. Parallelism is not important here.

refs #19489
Closes #19530

tests/http/test_07_upload.py

index ad2db48a8c9c58f7db1a0063c13d8f254e75ca29..93d1fb26bf159da10014f540f34e57a5b030f62f 100644 (file)
@@ -263,15 +263,18 @@ class TestUpload:
         r.check_response(count=count, http_status=200)
         self.check_download(r, count, fdata, curl)
 
-    # upload large data parallel to a URL that denies uploads
+    # upload single large data to a URL that fails uploads, causing RESETs
+    # (We used to do this for 20 parallel transfers, but the triggered
+    #  stream resets make nghttpx drop the connection after several, which
+    #  then gives a non-deterministic number of completely failed transfers)
     @pytest.mark.parametrize("proto", ['h2', 'h3'])
-    def test_07_22_upload_parallel_fail(self, env: Env, httpd, nghttpx, proto):
+    def test_07_22_upload_fail(self, env: Env, httpd, nghttpx, proto):
         if proto == 'h2' and not env.have_h2_curl():
             pytest.skip("h2 not supported")
         if proto == 'h3' and not env.have_h3():
             pytest.skip("h3 not supported")
         fdata = os.path.join(env.gen_dir, 'data-10m')
-        count = 20
+        count = 1
         curl = CurlClient(env=env)
         url = f'https://{env.authority_for(env.domain1, proto)}'\
             f'/curltest/tweak?status=400&delay=5ms&chunks=1&body_error=reset&id=[0-{count-1}]'