From: Otto Moerbeek Date: Tue, 17 Feb 2026 15:40:59 +0000 (+0100) Subject: Make status polls faster X-Git-Tag: dnsdist-2.1.0-beta1~13^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a45a4b745e340599ccfc8ac6a3961ce44f04cfe;p=thirdparty%2Fpdns.git Make status polls faster Signed-off-by: Otto Moerbeek --- diff --git a/regression-tests.recursor-dnssec/recursortests.py b/regression-tests.recursor-dnssec/recursortests.py index 5fe2fa477a..a93b84a40e 100644 --- a/regression-tests.recursor-dnssec/recursortests.py +++ b/regression-tests.recursor-dnssec/recursortests.py @@ -580,7 +580,7 @@ distributor-threads={threads} @classmethod def waitForTCPSocket(cls, ipaddress, port): - for try_number in range(0, 100): + for try_number in range(0, 1000): try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(1.0) @@ -590,7 +590,7 @@ distributor-threads={threads} except Exception as err: if err.errno != errno.ECONNREFUSED: print(f'Error occurred: {try_number} {err}', file=sys.stderr) - time.sleep(0.1) + time.sleep(0.01) @classmethod def startAuth(cls, confdir, ipaddress): @@ -825,11 +825,11 @@ distributor-threads={threads} return try: p.terminate() - for count in range(100): # tsan can be slow + for count in range(1000): # tsan can be slow x = p.poll() if x is not None: break - time.sleep(0.1) + time.sleep(0.01) if x is None: print("kill...", p, file=sys.stderr) p.kill() @@ -865,10 +865,10 @@ distributor-threads={threads} raise AssertionError('%s failed (%d): %s' % (rec_controlCmd, e.returncode, e.output)) # Wait for it, as the process really should have exited p = cls._recursor - for count in range(100): # tsan can be slow + for count in range(1000): # tsan can be slow if p.poll() is not None: break - time.sleep(0.1) + time.sleep(0.01) if p.poll() is None: raise AssertionError('Process did not exit on request within 10s') if p.returncode not in (0, -15): diff --git a/regression-tests.recursor-dnssec/test_Carbon.py b/regression-tests.recursor-dnssec/test_Carbon.py index 9b4c9d2603..6b51bf7856 100644 --- a/regression-tests.recursor-dnssec/test_Carbon.py +++ b/regression-tests.recursor-dnssec/test_Carbon.py @@ -12,7 +12,7 @@ class CarbonTest(RecursorTest): _carbonNamespace = 'NS' _carbonInstance = 'Instance' _carbonServerName = "carbonname1" - _carbonInterval = 2 + _carbonInterval = 1 _carbonServer1Port = 8000 _carbonServer2Port = 8001 _carbonQueue1 = Queue() diff --git a/regression-tests.recursor-dnssec/test_DoT.py b/regression-tests.recursor-dnssec/test_DoT.py index bc2a8bf8c0..5e7dd30a88 100644 --- a/regression-tests.recursor-dnssec/test_DoT.py +++ b/regression-tests.recursor-dnssec/test_DoT.py @@ -316,9 +316,9 @@ class DoTWithLocalResponderTests(RecursorTest): def tearDownResponders(cls): cls._backgroundThreads[cls._TLSResponder.native_id] = False count = 0 - while count < 20 and len(cls._backgroundThreads) != 0: + while count < 200 and len(cls._backgroundThreads) != 0: print(f'Waiting for background responder thread to exit {count}...') - time.sleep(0.1) + time.sleep(0.01) count = count + 1 def checkOnlyTLSResponderHit(self, numberOfTLSQueries=1): diff --git a/regression-tests.recursor-dnssec/test_FWCatz.py b/regression-tests.recursor-dnssec/test_FWCatz.py index 2132f87825..0d5ca4ef92 100644 --- a/regression-tests.recursor-dnssec/test_FWCatz.py +++ b/regression-tests.recursor-dnssec/test_FWCatz.py @@ -285,7 +285,7 @@ recursor: def checkForwards(self, expected): attempts = 0 - tries = 10 + tries = 100 ex = None while attempts < tries: try: @@ -296,7 +296,7 @@ recursor: except Exception as e: ex = e attempts = attempts + 1 - time.sleep(0.1) + time.sleep(0.01) if ex is not None: raise ex raise AssertionError('expected content not found') diff --git a/regression-tests.recursor-dnssec/test_TraceFail.py b/regression-tests.recursor-dnssec/test_TraceFail.py index db70664645..3c84ee3b8b 100644 --- a/regression-tests.recursor-dnssec/test_TraceFail.py +++ b/regression-tests.recursor-dnssec/test_TraceFail.py @@ -18,8 +18,8 @@ forward-zones-recurse=.=127.0.0.1:9999 grepCmd = ['grep', 'END OF FAIL TRACE', 'configs/' + self._confdir + '/recursor.log'] ret = b'' - for i in range(10): - time.sleep(1) + for i in range(1000): + time.sleep(0.01) try: ret = subprocess.check_output(grepCmd, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: diff --git a/regression-tests.recursor-dnssec/test_ZTC.py b/regression-tests.recursor-dnssec/test_ZTC.py index 814d547663..6a1d294553 100644 --- a/regression-tests.recursor-dnssec/test_ZTC.py +++ b/regression-tests.recursor-dnssec/test_ZTC.py @@ -23,8 +23,8 @@ recordcache: def testZTC(self): grepCmd = ['grep', 'validationStatus="Secure"', 'configs/' + self._confdir + '/recursor.log'] ret = b'' - for i in range(300): - time.sleep(0.1) + for i in range(3000): + time.sleep(0.01) try: ret = subprocess.check_output(grepCmd, stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: