Commit 9b7629699a for bind
commit 9b7629699aee68784a88347b27e18095d9a745c9
Author: Nicki Křížek <nicki@isc.org>
Date: Fri Oct 23 09:36:46 2026 +0000
Replace mtime sleeps before zone file rewrites with newer_mtime()
The one-second sleeps only made sure the rewritten zone file lands in a
later second; newer_mtime() does that without the wait.
Assisted-by: Claude:claude-opus-5-5
diff --git a/bin/tests/system/nsec3/tests_nsec3_change.py b/bin/tests/system/nsec3/tests_nsec3_change.py
index 87dbb5b5ba..1c7b7bd37d 100644
--- a/bin/tests/system/nsec3/tests_nsec3_change.py
+++ b/bin/tests/system/nsec3/tests_nsec3_change.py
@@ -10,7 +10,6 @@
# information regarding copyright ownership.
import shutil
-import time
import dns.name
import dns.rdataclass
@@ -18,6 +17,7 @@ import dns.rdatatype
import pytest
from isctest.algorithms import Algorithm
+from isctest.util import newer_mtime
from nsec3.common import (
NSEC3_MARK,
NSEC3_SALTLEN,
@@ -64,8 +64,8 @@ def after_servers_start(ns3, templates):
isctest.kasp.wait_keymgr_done(ns3, zone)
wait_for_nsec3param(ns3, zone, NSEC3_SALTLEN[zone].initial)
- time.sleep(1)
- shutil.copyfile(f"{nsdir}/template2.db.in", f"{nsdir}/{zone}.db")
+ with newer_mtime(f"{nsdir}/{zone}.db"):
+ shutil.copyfile(f"{nsdir}/template2.db.in", f"{nsdir}/{zone}.db")
ns3.rndc(f"reload {zone}")
isctest.run.retry_with_timeout(check_soa_update, timeout=10)
diff --git a/bin/tests/system/xferquota/tests_xferquota.py b/bin/tests/system/xferquota/tests_xferquota.py
index 6fa1a7386e..ef37e12038 100644
--- a/bin/tests/system/xferquota/tests_xferquota.py
+++ b/bin/tests/system/xferquota/tests_xferquota.py
@@ -24,6 +24,8 @@ import dns.query
import dns.zone
import pytest
+from isctest.util import newer_mtime
+
import isctest
pytestmark = pytest.mark.extra_artifacts(
@@ -39,9 +41,8 @@ pytestmark = pytest.mark.extra_artifacts(
def test_xferquota(named_port, ns1, ns2):
- # Changing test zone ensuring that the time stamp changes
- time.sleep(1)
- shutil.copyfile("ns1/changing2.db", "ns1/changing.db")
+ with newer_mtime("ns1/changing.db"):
+ shutil.copyfile("ns1/changing2.db", "ns1/changing.db")
with open("ns1/named.pid", "r", encoding="utf-8") as pidfile:
pid = int(pidfile.read())
os.kill(pid, signal.SIGHUP)