]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Stop the responders more quickly during the tests 12328/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 14 Dec 2022 15:19:49 +0000 (16:19 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 14 Dec 2022 15:19:49 +0000 (16:19 +0100)
We use `SO_REUSEPORT` in these tests so if the old responder is
still around when the next test starts, it is quite likely that
it might get one of the new queries. This is usually fine because
responders with a different behaviour listen on different ports,
but if a query is queued to an old responder socket right during
the time that responder is checking whether it should stop and
the actual exit, the query will be lost.

regression-tests.dnsdist/dnsdisttests.py

index a11f6d1369ed903526ea06943d4ad886ddb94f5e..7ef003946bd72ce78c54586f44397d4be75f33d5 100644 (file)
@@ -247,7 +247,7 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
         sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
         sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
         sock.bind(("127.0.0.1", port))
-        sock.settimeout(1.0)
+        sock.settimeout(0.5)
         while True:
             try:
               data, addr = sock.recvfrom(4096)
@@ -363,7 +363,7 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
             sys.exit(1)
 
         sock.listen(100)
-        sock.settimeout(1.0)
+        sock.settimeout(0.5)
         if tlsContext:
           sock = tlsContext.wrap_socket(sock, server_side=True)
 
@@ -506,7 +506,7 @@ class DNSDistTest(AssertEqualDNSMessageMixin, unittest.TestCase):
             sys.exit(1)
 
         sock.listen(100)
-        sock.settimeout(1.0)
+        sock.settimeout(0.5)
         if tlsContext:
             sock = tlsContext.wrap_socket(sock, server_side=True)