adjust system tests to deal with possible timing issues
With the netmgr in use, named may start answering queries before zones are loaded. This can cause transient failures in system tests after servers are restarted or reconfigured. This commit adds retry loops and sleep statements where needed to address this problem. Also incidentally silenced a clang warning.
This commit is contained in:
@@ -61,9 +61,14 @@ $PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} nzd2nzf ns1
|
||||
|
||||
n=`expr $n + 1`
|
||||
echo_i "querying for zone data from migrated zone config ($n)"
|
||||
ret=0
|
||||
$DIG $DIGOPTS @10.53.0.1 a.added.example a > dig.out.ns1.$n || ret=1
|
||||
grep 'status: NOERROR' dig.out.ns1.$n > /dev/null || ret=1
|
||||
# retry loop in case the server restart above causes transient failures
|
||||
for try in 0 1 2 3 4 5 6 7 8 9; do
|
||||
ret=0
|
||||
$DIG $DIGOPTS @10.53.0.1 a.added.example a > dig.out.ns1.$n || ret=1
|
||||
grep 'status: NOERROR' dig.out.ns1.$n > /dev/null || ret=1
|
||||
[ "$ret" -eq 0 ] && break
|
||||
sleep 1
|
||||
done
|
||||
n=`expr $n + 1`
|
||||
if [ $ret != 0 ]; then echo_i "failed"; fi
|
||||
status=`expr $status + $ret`
|
||||
|
||||
Reference in New Issue
Block a user