]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
tests, make test_h2_106_02 more robust
authorStefan Eissing <icing@apache.org>
Tue, 2 May 2023 11:12:25 +0000 (11:12 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 2 May 2023 11:12:25 +0000 (11:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909567 13f79535-47bb-0310-9956-ffa450edef68

test/modules/http2/test_106_shutdown.py

index b119292b72d0f0325fecc8a4e5f2db9ba3cacdba..4d0efaae7c4a2ca2c09871e0966af583170f41d6 100644 (file)
@@ -63,7 +63,13 @@ class TestShutdown:
         assert env.apache_restart() == 0
         url = env.mkurl("https", "test1", "/index.html")
         for i in range(7):
-            r = env.curl_get(url, options=['-vvv'])
-            assert r.exit_code == 0, f"failed on {i}. request: {r.stdout} {r.stderr}"
-            assert r.response["status"] == 200
-            assert "HTTP/2" == r.response["protocol"]
\ No newline at end of file
+            r = env.curl_get(url, options=['-v'])
+            # requests should succeed, but rarely connections get closed
+            # before the response is received
+            if r.exit_code == 55:
+                # curl send error
+                assert r.response is None
+            else:
+                assert r.exit_code == 0, f"failed on {i}. request: {r.stdout} {r.stderr}"
+                assert r.response["status"] == 200
+                assert "HTTP/2" == r.response["protocol"]
\ No newline at end of file