mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 12:13:20 -04:00
[9.18] 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. Backport of MR !9507 Merge branch 'backport-mnowak/shutdown-downgrade-timeout-and-attempts-arguments-9.18' into 'bind-9.18' See merge request isc-projects/bind9!9542
This commit is contained in:
commit
cecadee2e9
2 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
Loading…
Reference in a new issue