]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: workaround a potential (but rare) race in the FWCatz test 15206/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 21 Feb 2025 11:07:41 +0000 (12:07 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 24 Feb 2025 08:25:57 +0000 (09:25 +0100)
regression-tests.recursor-dnssec/test_FWCatz.py

index f995d8f4a9a32b557f12e8287b74c261b8cb79b5..e8768bb7e85c106a31693efc6b21b009b6408261 100644 (file)
@@ -287,9 +287,22 @@ recursor:
         self.assertEqual(res.question[0].to_text(), 'forward.catz. IN SOA')
 
     def checkForwards(self, expected):
-        with open('configs/' + self._confdir + '/catzone.forward.catz.') as file:
-            reality = yaml.safe_load(file);
-            self.assertEqual(expected, reality)
+        attempts = 0
+        tries = 10
+        ex = None
+        while attempts < tries:
+            try:
+                with open('configs/' + self._confdir + '/catzone.forward.catz.') as file:
+                    reality = yaml.safe_load(file);
+                    if expected == reality:
+                        return
+            except Exception as e:
+                ex = e
+            attempts = attempts + 1
+            sleep(0.1)
+        if ex is not None:
+            raise ex
+        raise AssertionError('expected content not found')
 
     def waitUntilCorrectSerialIsLoaded(self, serial, timeout=5):
         global fwCatzServer