git » dnss » commit e0e45be

tests: Speed up the tests by waiting a little before querying over UDP

author Alberto Bertogli
2020-05-28 23:42:10 UTC
committer Alberto Bertogli
2020-05-29 00:38:51 UTC
parent 6e347042a2e376b9d69577fada9569bf0d1041a0

tests: Speed up the tests by waiting a little before querying over UDP

When we query over UDP, we don't wait for the server to come up, which
means the first request is usually lost, and we need to wait for it to
time out and then retry. This is not a big issue but it slows down the
tests a few seconds.

This patch makes the tests wait 200ms before issuing the query, which is
often long enough for the server to come up.

There is no difference in the result, this only causes the tests to be
faster in the common case.

tests/external.sh +1 -0

diff --git a/tests/external.sh b/tests/external.sh
index ffdbe66..8e42aa6 100755
--- a/tests/external.sh
+++ b/tests/external.sh
@@ -237,6 +237,7 @@ echo "## Socket activation via systemd: UDP"
 SYSTEMD_ACTIVATE="systemd-socket-activate -d -l 1053"
 dnss -enable_dns_to_https -dns_listen_addr "systemd"
 
+sleep 0.2
 kdig @127.0.0.1:1053 +notcp  example.com a > .dig.log
 grep -E -q '^example.com.*A'  .dig.log