]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Reduce the timeout on Dynamic Block tests expected to fail
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 1 Feb 2024 13:46:11 +0000 (14:46 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 5 Feb 2024 10:36:21 +0000 (11:36 +0100)
regression-tests.dnsdist/dnsdistDynBlockTests.py
regression-tests.dnsdist/dnsdisttests.py

index 27b4f3cfa98af0ddcdc6cb9eb0c280c51c347eea..f9acc85952554c308147987784d5a0fa71d54bdf 100644 (file)
@@ -78,7 +78,7 @@ class DynBlocksTest(DNSDistTest):
             waitForMaintenanceToRun()
 
         # we should now be dropped for up to self._dynBlockDuration + self._dynBlockPeriod
-        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=1)
+        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=0.5)
         self.assertEqual(receivedResponse, None)
 
         if testViaAPI:
@@ -117,7 +117,7 @@ class DynBlocksTest(DNSDistTest):
             waitForMaintenanceToRun()
 
         # we should now be dropped for up to self._dynBlockDuration + self._dynBlockPeriod
-        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
+        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False, timeout=0.5)
         self.assertEqual(receivedResponse, None)
 
         # wait until we are not blocked anymore
@@ -294,7 +294,7 @@ class DynBlocksTest(DNSDistTest):
         allowed = 0
         sent = 0
         for _ in range(int(dynBlockBytesPerSecond * 5 / len(response.to_wire()))):
-            (receivedQuery, receivedResponse) = self.sendTCPQuery(query, response)
+            (receivedQuery, receivedResponse) = self.sendTCPQuery(query, response, timeout=0.5)
             sent = sent + len(response.to_wire())
             if receivedQuery:
                 receivedQuery.id = query.id
@@ -429,7 +429,7 @@ class DynBlocksTest(DNSDistTest):
             waitForMaintenanceToRun()
 
         # we should now be dropped for up to self._dynBlockDuration + self._dynBlockPeriod
-        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
+        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False, timeout=0.5)
         self.assertEqual(receivedResponse, None)
 
         # wait until we are not blocked anymore
@@ -536,7 +536,7 @@ class DynBlocksTest(DNSDistTest):
         waitForMaintenanceToRun()
 
         # we should now be dropped for up to self._dynBlockDuration + self._dynBlockPeriod
-        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
+        (_, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False, timeout=0.5)
         self.assertEqual(receivedResponse, None)
 
         # wait until we are not blocked anymore
index ef2dc35364bdc1feeb1badd8b44fecb23426181b..96d3caf3e4fcc510bb754a3aac7e8aac37ac07cc 100644 (file)
@@ -705,8 +705,8 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
             return (None, None)
 
         try:
-            cls.sendTCPQueryOverConnection(sock, query, rawQuery)
-            message = cls.recvTCPResponseOverConnection(sock)
+            cls.sendTCPQueryOverConnection(sock, query, rawQuery, timeout=timeout)
+            message = cls.recvTCPResponseOverConnection(sock, timeout=timeout)
         except socket.timeout as e:
             print("Timeout while sending or receiving TCP data: %s" % (str(e)))
         except socket.error as e: