From 6eb2088320a8984cc3abdd0f39205bbc4ffef00a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicki=20K=C5=99=C3=AD=C5=BEek?= Date: Mon, 26 Jan 2026 10:45:34 +0100 Subject: [PATCH] Fix a race condition in dnssec test When dumpdb command is executed, it might take a while until the file is written. Rather than checking the file once, use the WatchLog mechanism to allow the desired line to appear before a timeout happens. This affected test_validation_recovery and test_cache tests which have been intermittently failing on EL8 in our CI. --- bin/tests/system/dnssec/tests_validation.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/tests/system/dnssec/tests_validation.py b/bin/tests/system/dnssec/tests_validation.py index c713d3a6b25..82a54f322c6 100644 --- a/bin/tests/system/dnssec/tests_validation.py +++ b/bin/tests/system/dnssec/tests_validation.py @@ -704,13 +704,14 @@ def test_negative_validation_optout(): def test_cache(ns4): - # check that key id's are logged when dumping the cache ns4.rndc("dumpdb -cache") - dumpdb = isctest.text.TextFile("ns4/named_dump.db") - assert "; key id = " in dumpdb - - # check for RRSIG covered type in negative cache - assert "; example. RRSIG NSEC " in dumpdb + with isctest.log.WatchLogFromStart("ns4/named_dump.db") as watcher: + watcher.wait_for_all( + [ + "; key id = ", # check that key id's are logged when dumping the cache + "; example. RRSIG NSEC ", # check for RRSIG covered type in negative cache + ] + ) # check validated data are not cached longer than originalttl msg = isctest.query.create("a.ttlpatch.example", "A") @@ -938,8 +939,8 @@ def test_validation_recovery(ns2, ns4): res = isctest.query.tcp(msg, "10.53.0.4") isctest.check.servfail(res) ns4.rndc("dumpdb") - dumpdb = isctest.text.TextFile("ns4/named_dump.db") - assert "10.53.0.100" in dumpdb + with isctest.log.WatchLogFromStart("ns4/named_dump.db") as watcher: + watcher.wait_for_line("10.53.0.100") # then reload server with properly signed zone shutil.copyfile( -- 2.47.3