serve-stale tests false negative
Job #1772976 failed for d4f7963d:
8455I:serve-stale:sending queries for tests 144-145...
8456I:serve-stale:enable responses from authoritative server (143)
8457I:serve-stale:check not in cache longttl.example times out (stale-answer-client-timeout 1.8) (144)
8458I:serve-stale:check not in cache longttl.example comes from authoritative (stale-answer-client-timeout 1.8) (145)
8459I:serve-stale:failed
Both digs completed within a second of each other but only one of the
two passed despite the contents matching the expected values which leads
me to conclude that dig.out.test145
was still being written when the
grep
s where made.
% ls -lT dig.out.test14[45]
-rw-r--r--@ 1 marka staff 184 3 Jun 14:42:51 2021 dig.out.test144
-rw-r--r--@ 1 marka staff 664 3 Jun 14:42:52 2021 dig.out.test145
%
% grep "status: NOERROR" dig.out.test145
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46667
% grep "ANSWER: 1," dig.out.test145
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
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() {
[ -s "$1" ] || return 1
}
retry_quiet 3 waitfile dig.out.test$n || ret=1
grep "connection timed out" dig.out.test$n > /dev/null || 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
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status+ret))