From 47b850348cbc2961bc44eb31c05cd620e5fc35f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Wed, 29 May 2019 11:05:01 +0200 Subject: [PATCH] Optimize dig parameters to decrease test run time Performing server setup checks using "+tries=3 +time=5" is redundant as a single query is arguably good enough for determining whether a given named instance was set up properly. Only use multiple queries with a long timeout for resolution checks in the "legacy" system test, in order to significantly reduce its run time (on a contemporary machine, from about 1m45s to 0m40s). --- bin/tests/system/legacy/tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/tests/system/legacy/tests.sh b/bin/tests/system/legacy/tests.sh index f96055bb1b..6d1e807511 100755 --- a/bin/tests/system/legacy/tests.sh +++ b/bin/tests/system/legacy/tests.sh @@ -12,13 +12,13 @@ SYSTEMTESTTOP=.. . $SYSTEMTESTTOP/conf.sh -DIGOPTS="-p ${PORT} +tries=3 +time=5" +DIGOPTS="-p ${PORT} +tries=1 +time=2" # Check whether the SOA record for the name provided in $1 can be resolved by # ns1. Return 0 if resolution succeeds as expected; return 1 otherwise. resolution_succeeds() { _ret=0 - $DIG $DIGOPTS +tcp @10.53.0.1 ${1} SOA > dig.out.test$n || _ret=1 + $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} SOA > dig.out.test$n || _ret=1 grep "status: NOERROR" dig.out.test$n > /dev/null || _ret=1 return $_ret } @@ -31,7 +31,7 @@ resolution_succeeds() { resolution_fails() { _servfail=0 _timeout=0 - $DIG $DIGOPTS +tcp @10.53.0.1 ${1} SOA > dig.out.test$n + $DIG $DIGOPTS +tcp +tries=3 +time=5 @10.53.0.1 ${1} SOA > dig.out.test$n grep "status: SERVFAIL" dig.out.test$n > /dev/null && _servfail=1 grep "connection timed out" dig.out.test$n > /dev/null && _timeout=1 if [ $_servfail -eq 1 ] || [ $_timeout -eq 1 ]; then