Commit af95cb8c authored by Mark Andrews's avatar Mark Andrews
Browse files

Address test race condition in serve-stale

the dig.out.test# files could still be being written when the
content greps where being made.
parent d242ccfb
Pipeline #73578 passed with stages
in 19 minutes and 58 seconds
......@@ -1705,20 +1705,25 @@ 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
waitfile() {
check_results() {
[ -s "$1" ] || return 1
grep "connection timed out" "$1" > /dev/null || return 1
return 0
}
retry_quiet 3 waitfile dig.out.test$n || ret=1
grep "connection timed out" dig.out.test$n > /dev/null || ret=1
retry_quiet 3 check_results dig.out.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
n=$((n+1))
echo_i "check not in cache longttl.example comes from authoritative (stale-answer-client-timeout 1.8) ($n)"
ret=0
retry_quiet 7 waitfile dig.out.test$n || ret=1
grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1
check_results() {
[ -s "$1" ] || return 1
grep "status: NOERROR" "$1" > /dev/null || return 1
grep "ANSWER: 1," "$1" > /dev/null || return 1
return 0
}
retry_quiet 7 check_results dig.out.test$n || ret=1
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment