]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Tighten serve_stale dig timeouts and inter-step sleeps
authorOndřej Surý <ondrej@isc.org>
Thu, 14 May 2026 11:58:59 +0000 (13:58 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 19 May 2026 09:18:30 +0000 (11:18 +0200)
With the TCP fallback now actually firing after repeated UDP timeouts,
the resolver covers more retry transitions in the same wall-clock
window, and the original 3-second budgets in two steps of the
serve_stale test left no margin: the dig client at +timeout=3 and the
"sleep 3" before re-enabling the upstream both straddled the moment at
which the resolver switched transport, making the asserted outcome
race-prone.

Drop the dig timeout to 2s and the sleep to 1s so each step lands
firmly on one side of the transport switch.

Co-authored-by: Evan Hunt <each@isc.org>
Assisted-by: Claude:claude-opus-4-7
bin/tests/system/serve_stale/tests.sh

index 90841afe6aa4c850991f9621e3d0c436c020c3cc..fe862b2949e1edf1da3f8cdd7a1732908e88dfbd 100755 (executable)
@@ -1399,7 +1399,7 @@ sleep 2
 n=$((n + 1))
 echo_i "check notincache.example TXT times out (max-stale-ttl default) ($n)"
 ret=0
-$DIG -p ${PORT} +tries=1 +timeout=3 @10.53.0.3 notfound.example TXT >dig.out.test$n 2>&1 && ret=1
+$DIG -p ${PORT} +tries=1 +timeout=2 @10.53.0.3 notfound.example TXT >dig.out.test$n 2>&1 && ret=1
 grep "timed out" dig.out.test$n >/dev/null || ret=1
 grep ";; no servers could be reached" dig.out.test$n >/dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
@@ -1947,7 +1947,7 @@ status=$((status + ret))
 # authoritative server.
 echo_i "sending query for test $((n + 2))"
 $DIG -p ${PORT} @10.53.0.3 data.example TXT >dig.out.test$((n + 2)) &
-sleep 3
+sleep 1
 
 n=$((n + 1))
 echo_i "enable responses from authoritative server ($n)"