]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
pytests/conn_flood: attempt to make test more stable in CI
authorTomas Krizek <tomas.krizek@nic.cz>
Fri, 4 Jan 2019 15:20:21 +0000 (16:20 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Tue, 8 Jan 2019 15:48:49 +0000 (16:48 +0100)
tests/pytests/conn_flood.py

index aa53b7007b0436179f6f7ef58e1fd660dcbb171f..8c2625a9a0f6463ddda79f048226cae9741c94d6 100644 (file)
@@ -17,8 +17,8 @@ from kresd import Kresd
 import utils
 
 
-MAX_SOCKETS = 20000  # upper bound of how many connections to open
-MAX_ITERATIONS = 20  # number of iterations to run the test
+MAX_SOCKETS = 10000  # upper bound of how many connections to open
+MAX_ITERATIONS = 10  # number of iterations to run the test
 
 # we can't use softlimit ifself since kresd already has open sockets,
 # so use lesser value
@@ -50,8 +50,8 @@ def test_conn_flood(tmpdir, sock_func_name):
             for s in sockets:
                 utils.ping_alive(s)
 
-            # break when no more than 10% additional sockets are created
-            if additional_sockets / len(sockets) < 0.1:
+            # break when no more than 20% additional sockets are created
+            if additional_sockets / len(sockets) < 0.2:
                 return sockets
 
     max_num_of_open_files = resource.getrlimit(resource.RLIMIT_NOFILE)[0] - RESERVED_NOFILE