]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Reduce the UDP wait time for blocked queries in the tests 13196/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 30 Aug 2023 13:55:01 +0000 (15:55 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 30 Aug 2023 13:55:01 +0000 (15:55 +0200)
We know that we are not going to get a response, and waiting for too
long increases the risk that the dynamic block is no longer present
and/or has expired (validity of 0s) in the subsequent API check.

regression-tests.dnsdist/dnsdistDynBlockTests.py

index ccee6eb7c36bd388c64780dac23284766f428a6a..67f986b585e14f8a69c98b1014bd6c16b078d0f8 100644 (file)
@@ -77,7 +77,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)
+        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=1)
         self.assertEqual(receivedResponse, None)
 
         if testViaAPI:
@@ -269,7 +269,7 @@ class DynBlocksTest(DNSDistTest):
         print(time.time())
 
         # we should now be dropped for up to self._dynBlockDuration + self._dynBlockPeriod
-        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False)
+        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=1)
         self.assertEqual(receivedResponse, None)
 
         print(self.sendConsoleCommand("showDynBlocks()"))
@@ -378,7 +378,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)
+        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=1)
         self.assertEqual(receivedResponse, None)
 
         # wait until we are not blocked anymore
@@ -487,7 +487,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)
+        (_, receivedResponse) = self.sendUDPQuery(query, response=None, useQueue=False, timeout=1)
         self.assertEqual(receivedResponse, None)
 
         # wait until we are not blocked anymore