From: Remi Gacogne Date: Wed, 30 Aug 2023 13:55:01 +0000 (+0200) Subject: dnsdist: Reduce the UDP wait time for blocked queries in the tests X-Git-Tag: rec-5.0.0-alpha1~29^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13196%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Reduce the UDP wait time for blocked queries in the tests 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. --- diff --git a/regression-tests.dnsdist/dnsdistDynBlockTests.py b/regression-tests.dnsdist/dnsdistDynBlockTests.py index ccee6eb7c3..67f986b585 100644 --- a/regression-tests.dnsdist/dnsdistDynBlockTests.py +++ b/regression-tests.dnsdist/dnsdistDynBlockTests.py @@ -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