From 5d91160a9c1d954ccc47530f85849b20b77230fc Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Sat, 15 Apr 2017 17:21:24 +0200 Subject: [PATCH] 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. --- regression-tests.dnsdist/test_DynBlocks.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- 2.47.2