2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

chg: test: 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.

Also, see isc-projects/bind9#4943.

Merge branch 'mnowak/shutdown-downgrade-timeout-and-attempts-arguments' into 'main'

See merge request isc-projects/bind9!9507
This commit is contained in:
Michal Nowak
2024-09-23 15:39:16 +00:00
2 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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":