Retry transient DNS timeouts in retry_with_timeout()

A transient query timeout should retry, not fail the test.

Assisted-by: Claude:claude-opus-4-8
This commit is contained in:
Michal Nowak 2026-06-02 14:53:25 +00:00
parent 3f8e472292
commit a7d1207324

View 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)