]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix flaky Proxy Protocol regression test 16899/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 17 Feb 2026 15:47:03 +0000 (16:47 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 17 Feb 2026 15:47:03 +0000 (16:47 +0100)
We can only check that we did not open more than one new connection
compared to the connections that existed before, because connections
triggered by a different test can still be around.
This seems to be happening on a regular basis on slow runners with
few CPU cores.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
regression-tests.dnsdist/test_ProxyProtocol.py

index 2dd9cf3580255113f14b5e53b497e1e85e193a72..c2c98686dcbcb8fb77e5f8cbad25299303686beb 100644 (file)
@@ -375,6 +375,7 @@ class TestProxyProtocol(ProxyProtocolTest):
 
       new_conn_before = self.getServerStats()[0]['tcpNewConnections']
       reused_conn_before = self.getServerStats()[0]['tcpReusedConnections']
+      max_conn_before = self.getServerStats()[0]['tcpMaxConcurrentConnections']
 
       conn = self.openTCPConnection(2.0)
       data = query.to_wire()
@@ -406,7 +407,10 @@ class TestProxyProtocol(ProxyProtocolTest):
       server = self.getServerStats()[0]
       self.assertEqual(server['tcpNewConnections'], new_conn_before + 1)
       self.assertEqual(server['tcpReusedConnections'], reused_conn_before + 9)
-      self.assertEqual(server['tcpMaxConcurrentConnections'], 1)
+      # we can only check that we did not open more than one new connection
+      # compared to the connections that existed before, because connections
+      # triggered by a different test can still be around
+      self.assertLessEqual(server['tcpMaxConcurrentConnections'], max_conn_before + 1)
 
     def testProxyTCPSeveralQueriesWithRandomTLVOnSameConnection(self):
       """