]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Retry transient DNS timeouts in retry_with_timeout()
authorMichal Nowak <mnowak@isc.org>
Tue, 2 Jun 2026 14:53:25 +0000 (14:53 +0000)
committerMichal Nowak <mnowak@isc.org>
Wed, 10 Jun 2026 19:15:09 +0000 (19:15 +0000)
A transient query timeout should retry, not fail the test.

Assisted-by: Claude:claude-opus-4-8
bin/tests/system/isctest/run.py

index 4e11c71ba010855a0939144b956507192aa878e1..12e403ff622b00b3704a13c8df1a61c6540a5a7b 100644 (file)
@@ -15,6 +15,8 @@ import os
 import subprocess
 import time
 
+import dns.exception
+
 import isctest.log
 import isctest.text
 
@@ -150,7 +152,8 @@ def retry_with_timeout(func, timeout, delay=1, msg=None):
             if func():
                 isctest.log.debug(f"retry_with_timeout: {fname} succeeded")
                 return
-        except AssertionError as exc:
+        except (AssertionError, dns.exception.Timeout) as exc:
+            # A transient query timeout means "not ready yet"; keep retrying.
             exc_msg = str(exc)
         isctest.log.debug(f"retry_with_timeout: {fname} failed, sleep {delay}s")
         time.sleep(delay)