]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Warn when log files grow too big in system tests
authorMichał Kępień <michal@isc.org>
Wed, 28 Apr 2021 05:56:47 +0000 (07:56 +0200)
committerMichał Kępień <michal@isc.org>
Wed, 28 Apr 2021 06:36:56 +0000 (08:36 +0200)
Exerting excessive I/O load on the host running system tests should be
avoided in order to limit the number of false positives reported by the
system test suite.  In some cases, running named with "-d 99" (which is
the default for system tests) results in a massive amount of logs being
generated, most of which are useless.  Implement a log file size check
to draw developers' attention to overly verbose named instances used in
system tests.  The warning threshold of 200,000 lines was chosen
arbitrarily.

(cherry picked from commit 241e85ef0c2d9ce71aecb13357369b5e92250aa0)

bin/tests/system/run.sh

index 8235a4588371ce8bd3b235f9195083e0e0c149c1..89e530562d957ddfa4d0cfce139383daa6d11665 100755 (executable)
@@ -318,6 +318,11 @@ else
     fi
 fi
 
+NAMED_RUN_LINES_THRESHOLD=200000
+find "${systest}" -type f -name "named.run" -exec wc -l {} \; | awk "\$1 > ${NAMED_RUN_LINES_THRESHOLD} { print \$2 }" | sort | while read -r LOG_FILE; do
+    echowarn "I:${systest}:${LOG_FILE} contains more than ${NAMED_RUN_LINES_THRESHOLD} lines, consider tweaking the test to limit disk I/O"
+done
+
 echoend "E:$systest:$(date_with_args)"
 
 exit $status