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:
@@ -39,14 +39,14 @@ def generic_query(
|
|||||||
for attempt in range(attempts):
|
for attempt in range(attempts):
|
||||||
try:
|
try:
|
||||||
isctest.log.debug(
|
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}"
|
f"timeout={timeout}, attempts left={attempts-attempt}"
|
||||||
)
|
)
|
||||||
res = query_func(message, ip, timeout, port=port, source=source)
|
res = query_func(message, ip, timeout, port=port, source=source)
|
||||||
if res.rcode() == expected_rcode or expected_rcode is None:
|
if res.rcode() == expected_rcode or expected_rcode is None:
|
||||||
return res
|
return res
|
||||||
except (dns.exception.Timeout, ConnectionRefusedError) as e:
|
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)
|
time.sleep(1)
|
||||||
raise dns.exception.Timeout
|
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"
|
qname = relname + ".test"
|
||||||
msg = dns.message.make_query(qname, "A")
|
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
|
elif shutdown: # We attempt to stop named in the middle
|
||||||
shutdown = False
|
shutdown = False
|
||||||
if kill_method == "rndc":
|
if kill_method == "rndc":
|
||||||
|
Reference in New Issue
Block a user