]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: fix a race in the dnstap regression tests
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 14 Aug 2024 11:37:23 +0000 (13:37 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 14 Aug 2024 11:50:38 +0000 (13:50 +0200)
A test might finish "too early". In that case not all workers are
fully setup yet, and leak sanitizer crashes due to a stack out of
bounds.

One case fixed by introducing a sleep (for a test to see if the
dnstap queue is empty), and one actually querying an existing
out-of-band domain, which was enough for me to get all threads
properly setup. Previously it would check a domain and get
connnection refused, as this test does not setup auths at all.
The assumption is that that causes a "too fast exit" of rec.

regression-tests.recursor-dnssec/test_RecDnstap.py

index b975483d7d76e3367b0783368216d1ef3d45278c..d84d6bccc78f06acfa22091269b86db9cdc8f035 100644 (file)
@@ -4,6 +4,7 @@ import socket
 import struct
 import sys
 import threading
+import time
 import dns
 import dnstap_pb2
 from unittest import SkipTest
@@ -330,6 +331,7 @@ dnstapFrameStreamServer({"%s"}, {logQueries=false})
         self.assertNotEqual(res, None)
 
         # We don't expect anything
+        time.sleep(1)
         self.assertTrue(DNSTapServerParameters.queue.empty())
 
 class DNSTapLogNODTest(TestRecursorDNSTap):
@@ -368,7 +370,7 @@ dnstapNODFrameStreamServer({"%s"})
         return dnstap
 
     def testA(self):
-        name = 'www.example.org.'
+        name = 'types.example.'
         query = dns.message.make_query(name, 'A', want_dnssec=True)
         query.flags |= dns.flags.RD
         res = self.sendUDPQuery(query)