From: Remi Gacogne Date: Sat, 15 Apr 2017 15:21:24 +0000 (+0200) Subject: dnsdist: Stop sending queries as soon as we are dyn-blocked in tests X-Git-Tag: rec-4.1.0-alpha1~159^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d91160a9c1d954ccc47530f85849b20b77230fc;p=thirdparty%2Fpdns.git dnsdist: Stop sending queries as soon as we are dyn-blocked in tests 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. --- diff --git a/regression-tests.dnsdist/test_DynBlocks.py b/regression-tests.dnsdist/test_DynBlocks.py index 545695dfb5..2ac40530c5 100644 --- a/regression-tests.dnsdist/test_DynBlocks.py +++ b/regression-tests.dnsdist/test_DynBlocks.py @@ -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