From 05e73a24f0de7155794388d623e3342d3f8aeae2 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Thu, 10 Jun 2021 09:55:17 +0200 Subject: [PATCH] Bump wait time in servestale test with 1 second This check intermittently failed: I:serve-stale:check not in cache longttl.example times out... I:serve-stale:failed This corresponds to this query in the test: $DIG -p ${PORT} +tries=1 +timeout=3 @10.53.0.3 longttl.example TXT Looking at the dig output for a failed test, the query actually got a response from the authoritative server (in one specific example the query time was 2991 msec, close to 3 seconds). After doing the query for the test, we enable the authoritative server after a sleep of three seconds. If we bump this sleep to 4 seconds, the race will be more in favor of the query timing out, making it unlikely that this test will fail intermittently. Bump the subsequent wait_for_log checks also with one second. --- bin/tests/system/serve-stale/tests.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh index b3b0071090..c49f6647bf 100755 --- a/bin/tests/system/serve-stale/tests.sh +++ b/bin/tests/system/serve-stale/tests.sh @@ -1694,7 +1694,7 @@ $DIG -p ${PORT} +tries=1 +timeout=10 @10.53.0.3 longttl.example TXT > dig.out.t n=$((n+1)) echo_i "enable responses from authoritative server ($n)" ret=0 -sleep 3 +sleep 4 $DIG -p ${PORT} @10.53.0.2 txt enable > dig.out.test$n grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1 @@ -1704,13 +1704,13 @@ status=$((status+ret)) n=$((n+1)) echo_i "check not in cache longttl.example times out (stale-answer-client-timeout 1.8) ($n)" ret=0 -wait_for_log 3 "longttl.example client timeout, stale answer unavailable" ns3/named.run || ret=1 +wait_for_log 4 "longttl.example client timeout, stale answer unavailable" ns3/named.run || ret=1 check_results() { [ -s "$1" ] || return 1 grep "connection timed out" "$1" > /dev/null || return 1 return 0 } -retry_quiet 3 check_results dig.out.test$n || ret=1 +retry_quiet 4 check_results dig.out.test$n || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret)) @@ -1723,7 +1723,7 @@ check_results() { grep "ANSWER: 1," "$1" > /dev/null || return 1 return 0 } -retry_quiet 7 check_results dig.out.test$n || ret=1 +retry_quiet 8 check_results dig.out.test$n || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi status=$((status+ret))