]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Account for idle timeouts in the "dispatch" test
authorMichał Kępień <michal@isc.org>
Wed, 23 Jul 2025 10:16:25 +0000 (12:16 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Thu, 24 Jul 2025 11:09:49 +0000 (13:09 +0200)
When the tests-connreset.py module was initially implemented in commit
5c17919019ef0af8226e5bb61214b805bb3e2451, the dispatch code did not
properly apply the idle timeout to TCP connections.  This allowed the
check in that test module to reset the TCP connection after 5 seconds as
named did not attempt to tear the connection down earlier than that.
However, as the dispatch code was improved, the idle timeout started
being enforced for TCP dispatches; the exact value it is set to in the
current code depends on a given server's SRTT, but it defaults to about
1.2 seconds for responsive servers.  This means that the code paths
triggered by the "dispatch" system test are now different than the ones
it was originally supposed to trigger because it is now named itself
that shuts the TCP connection down cleanly before the ans3 server gets a
chance to reset it.

Account for the above by lowering the amount of time after which the
ans3 server in the "dispatch" system test resets TCP connections to just
1 second, so that the test actually does what its name implies.

bin/tests/system/dispatch/ans3/ans.py

index 270ac38e3e637193d4ab56e153897c9abfa00ca3..653232f9915bc1d926e5bfff1ce77c85ed37bbb4 100644 (file)
@@ -36,7 +36,7 @@ class TruncateOnUdpHandler(ResponseHandler):
 
 def main() -> None:
     server = AsyncDnsServer()
-    server.install_connection_handler(ConnectionReset(delay=5.0))
+    server.install_connection_handler(ConnectionReset(delay=1.0))
     server.install_response_handler(TruncateOnUdpHandler())
     server.run()