]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix flaky TCP rate limiting regression tests
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 11 May 2026 15:43:12 +0000 (17:43 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 11 May 2026 15:43:12 +0000 (17:43 +0200)
Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
regression-tests.dnsdist/test_TCPLimits.py

index 383973504191e28a0e3aa6ae1c080f98eac98549..87aac30a3fea1ed3459a36fd0884bb47fc7482c5 100644 (file)
@@ -245,7 +245,7 @@ class TestTCPLimitsConnectionRate(DNSDistTest):
         # if we are unlucky a few of our connections fell into a different bucket,
         # which is more likely if the test runner is slow, so let's allow up to
         # self._maxConnectionRate * 2
-        for idx in range(self._maxConnectionRate):
+        for idx in range(self._maxConnectionRate + 1):
             (receivedQuery, receivedResponse) = self.sendTCPQuery(query, response=None, useQueue=False)
             if receivedQuery is None and receivedResponse is None:
                 blocked = True
@@ -308,7 +308,7 @@ class TestTCPLimitsTLSNewSessionRate(DNSDistTest):
         # if we are unlucky a few of our connections fell into a different bucket,
         # which is more likely if the test runner is slow, so let's allow up to
         # _maxNewTLSSessionRate * 2 + 1
-        for idx in range(self._maxNewTLSSessionRate):
+        for idx in range(self._maxNewTLSSessionRate + 1):
             try:
                 self.sendDOTQueryWrapper(query, response=None, useQueue=False)
             except ConnectionResetError:
@@ -387,8 +387,8 @@ class TestTCPLimitsTLSResumedSessionRate(DNSDistTest):
         blocked = False
         # if we are unlucky a few of our connections fell into a different bucket,
         # which is more likely if the test runner is slow, so let's allow up to
-        # self._maxResumedTLSSessionRate * 2 = 2
-        for idx in range(self._maxResumedTLSSessionRate):
+        # self._maxResumedTLSSessionRate * 2 + 2
+        for idx in range(self._maxResumedTLSSessionRate + 1):
             try:
                 conn = self.openTLSConnection(
                     self._tlsServerPort, self._serverName, self._caCert, timeout=1, sslctx=sslctx, session=session