From 463ab2f3f5f649c3fef162dbd05890c34eac43b4 Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Mon, 16 Sep 2024 14:55:06 +0200 Subject: [PATCH 1/2] Downgrade "timeout" and "attempts" arguments in shutdown The shutdown system test sends queries when named is shutting down, not in an attempt to get answers but to destabilize the server into a crash. With isctest.query.udp() defaulting to try up to ten times with a ten-second timeout to get a response we don't care about from a likely terminated server, we make the test run much longer than needed because of retries and long timeouts. --- bin/tests/system/shutdown/tests_shutdown.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/tests/system/shutdown/tests_shutdown.py b/bin/tests/system/shutdown/tests_shutdown.py index 121feed7b7..566a84fc8e 100755 --- a/bin/tests/system/shutdown/tests_shutdown.py +++ b/bin/tests/system/shutdown/tests_shutdown.py @@ -101,7 +101,11 @@ def do_work(named_proc, resolver_ip, instance, kill_method, n_workers, n_queries qname = relname + ".test" msg = dns.message.make_query(qname, "A") - futures[executor.submit(isctest.query.udp, msg, resolver_ip)] = tag + futures[ + executor.submit( + isctest.query.udp, msg, resolver_ip, timeout=1, attempts=1 + ) + ] = tag elif shutdown: # We attempt to stop named in the middle shutdown = False if kill_method == "rndc": From 1c637e96d1d81ca94d117aeb7cff0bcb7e8d748e Mon Sep 17 00:00:00 2001 From: Michal Nowak Date: Mon, 16 Sep 2024 14:43:22 +0200 Subject: [PATCH 2/2] Print correct udp/tcp function name in generic_query() --- bin/tests/system/isctest/query.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/tests/system/isctest/query.py b/bin/tests/system/isctest/query.py index 3e5ed8b78b..2fc1cccdfe 100644 --- a/bin/tests/system/isctest/query.py +++ b/bin/tests/system/isctest/query.py @@ -39,14 +39,14 @@ def generic_query( for attempt in range(attempts): try: isctest.log.debug( - f"{generic_query.__name__}(): ip={ip}, port={port}, source={source}, " + f"{query_func.__name__}(): ip={ip}, port={port}, source={source}, " f"timeout={timeout}, attempts left={attempts-attempt}" ) res = query_func(message, ip, timeout, port=port, source=source) if res.rcode() == expected_rcode or expected_rcode is None: return res except (dns.exception.Timeout, ConnectionRefusedError) as e: - isctest.log.debug(f"{generic_query.__name__}(): the '{e}' exceptio raised") + isctest.log.debug(f"{query_func.__name__}(): the '{e}' exceptio raised") time.sleep(1) raise dns.exception.Timeout