From: Remi Gacogne Date: Thu, 5 Jun 2025 11:06:22 +0000 (+0200) Subject: dnsdist: Fix a flaky Proxy Protocol regression test X-Git-Tag: dnsdist-2.0.0-beta1~46^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a0e2274596bf98047aee705d5d9538ead19533e;p=thirdparty%2Fpdns.git dnsdist: Fix a flaky Proxy Protocol regression test Signed-off-by: Remi Gacogne --- diff --git a/regression-tests.dnsdist/test_ProxyProtocol.py b/regression-tests.dnsdist/test_ProxyProtocol.py index 5619ae037b..b597469816 100644 --- a/regression-tests.dnsdist/test_ProxyProtocol.py +++ b/regression-tests.dnsdist/test_ProxyProtocol.py @@ -456,9 +456,15 @@ class TestProxyProtocol(ProxyProtocolTest): # in some cases existing (established before this test) connections to the backend might still # exist, so we cannot enforce a strict "only 1 connection" check self.assertLessEqual(server['tcpMaxConcurrentConnections'], max_conns_before + 1) - # but if we managed to add more than one connection to the existing ones, something is + # but if we managed to add more than two connections to the existing ones, something is # wrong! - self.assertLessEqual(server['tcpMaxConcurrentConnections'], current_conns_before + 1) + # why two and not one? when a query arrives we retrieve the "owned" outgoing connection to the backend, + # and we notice that the TLVs are different than the previous ones, so we discard the outgoing connection + # and create a new one. This should lead to only one concurrent connection, except that if we read the + # new query while being called from the function handling the response from the backend, we might still + # hold a shared reference to the previous connection. It will be released when we come back to the calling + # function, but for a short time we will have two concurrent connections. + self.assertLessEqual(server['tcpMaxConcurrentConnections'], current_conns_before + 2) class TestProxyProtocolIncoming(ProxyProtocolTest): """