]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: make test_12_01 a bit more forgiving on connection counts
authorStefan Eissing <stefan@eissing.org>
Thu, 30 Mar 2023 13:25:14 +0000 (15:25 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Apr 2023 06:46:53 +0000 (08:46 +0200)
tests/http/test_12_reuse.py

index 302929956c6fd002135520d1950f56b1e6b6ab6b..83bfadfe4ab339c937c027872dc02c9819b97f35 100644 (file)
@@ -56,7 +56,8 @@ class TestReuse:
         r.check_response(count=count, http_status=200)
         # Server sends `Connection: close` on every 2nd request, requiring
         # a new connection
-        assert r.total_connects == count/2
+        delta = 5
+        assert (count/2 - delta) < r.total_connects < (count/2 + delta)
 
     @pytest.mark.parametrize("proto", ['http/1.1'])
     def test_12_02_h1_conn_timeout(self, env: Env,
@@ -75,7 +76,3 @@ class TestReuse:
         r.check_response(count=count, http_status=200)
         # Connections time out on server before we send another request,
         assert r.total_connects == count
-        # we do not see how often a request was retried in the stats, so
-        # we cannot check that connection reuse attempted a connection that
-        # was later detected to be "dead". We would like to
-        # assert stat['retry_count'] == 0