]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Stop sending queries as soon as we are dyn-blocked in tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 15 Apr 2017 15:21:24 +0000 (17:21 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Sat, 15 Apr 2017 15:21:24 +0000 (17:21 +0200)
Otherwise we might take too much time to finish sending our queries
(2s timeout per query), ending up with the dynamic block rule gone
by the time we finish.

regression-tests.dnsdist/test_DynBlocks.py

index 545695dfb50f7413e75d8efd4762bd32c5a6e260..2ac40530c572ced64ced21b50d819bd74607f0b7 100644 (file)
@@ -393,6 +393,10 @@ class TestDynBlockResponseBytes(DNSDistTest):
                 # the query has not reached the responder,
                 # let's clear the response queue
                 self.clearToResponderQueue()
+                # and stop right there, otherwise we might
+                # wait for so long than the dynblock is gone
+                # by the time we finished
+                break
 
         # we might be already blocked, but we should have been able to send
         # at least self._dynBlockBytesPerSecond bytes
@@ -450,6 +454,10 @@ class TestDynBlockResponseBytes(DNSDistTest):
                 # the query has not reached the responder,
                 # let's clear the response queue
                 self.clearToResponderQueue()
+                # and stop right there, otherwise we might
+                # wait for so long than the dynblock is gone
+                # by the time we finished
+                break
 
         # we might be already blocked, but we should have been able to send
         # at least self._dynBlockBytesPerSecond bytes