]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix spurious failure of the TCP limits regression tests 15473/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 25 Apr 2025 14:55:11 +0000 (16:55 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 25 Apr 2025 14:55:11 +0000 (16:55 +0200)
The "maximum duration" test used to trigger the maximum number of
TCP read IOs, preventing the next test from being run. This commit
sets the maximum number of TCP read IOs to "unlimited" for this test.

regression-tests.dnsdist/test_TCPLimits.py

index c98d3641cda62479b8adac3808d242710d236ea7..7ecdcf6f9a1df295058142655f23cb299ed56366 100644 (file)
@@ -29,6 +29,9 @@ class TestTCPLimits(DNSDistTest):
     setMaxTCPConnectionDuration(%d)
     -- disable "near limits" otherwise our tests are broken because connections are forcibly closed
     setTCPConnectionsOverloadThreshold(0)
+    -- disable the maximum number of read IOs per query, otherwise the maximum duration (testTCPDuration)
+    -- test gets us banned very quickly
+    setMaxTCPReadIOsPerQuery(0)
     """
     _config_params = ['_testServerPort', '_tcpIdleTimeout', '_maxTCPQueriesPerConn', '_maxTCPConnsPerClient', '_maxTCPConnDuration']
 
@@ -161,6 +164,7 @@ class TestTCPLimitsReadIO(DNSDistTest):
         self.assertGreater(len(payload), self._maxTCPReadIOsPerQuery)
 
         conn = self.openTCPConnection()
+        conn.send(struct.pack("!H", len(payload)))
 
         count = 0
         failed = False