]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make status polls faster
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Feb 2026 15:40:59 +0000 (16:40 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 17 Feb 2026 15:40:59 +0000 (16:40 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
regression-tests.recursor-dnssec/recursortests.py
regression-tests.recursor-dnssec/test_Carbon.py
regression-tests.recursor-dnssec/test_DoT.py
regression-tests.recursor-dnssec/test_FWCatz.py
regression-tests.recursor-dnssec/test_TraceFail.py
regression-tests.recursor-dnssec/test_ZTC.py

index 5fe2fa477a1b36877f1c69cee6349ef360cfd46c..a93b84a40e44eed169c4ae8d5a59edaf0a781c17 100644 (file)
@@ -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):
index 9b4c9d260358d0f5338c19ac9d0f862a847eb7d3..6b51bf78562a993b6759d28b31a5110f006a649b 100644 (file)
@@ -12,7 +12,7 @@ class CarbonTest(RecursorTest):
     _carbonNamespace = 'NS'
     _carbonInstance = 'Instance'
     _carbonServerName = "carbonname1"
-    _carbonInterval = 2
+    _carbonInterval = 1
     _carbonServer1Port = 8000
     _carbonServer2Port = 8001
     _carbonQueue1 = Queue()
index bc2a8bf8c087129d6cc29412232c7cb7f3ba56d2..5e7dd30a8810d90e4f23c52cb515595ea14fcdc9 100644 (file)
@@ -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):
index 2132f87825e1b8efa3c3b079410a53b723afbeda..0d5ca4ef92ff7f39ef931d70f2a4eb7728cdc5ce 100644 (file)
@@ -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')
index db7066464584351c3c877ecbb7146de6d36fc3c2..3c84ee3b8b626b677280a5d6656a8ced35b69649 100644 (file)
@@ -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:
index 814d547663ac57bbd1d2a49be233231244ee4a12..6a1d2945531f37839d63d9b35a27b2314439b9c9 100644 (file)
@@ -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: