]> git.ipfire.org Git - thirdparty/knot-dns.git/commitdiff
tests-extra: ixfr/master_pin2 -- align the servers at the start
authorDavid Vašek <david.vasek@nic.cz>
Tue, 12 Aug 2025 15:37:00 +0000 (17:37 +0200)
committerDavid Vašek <david.vasek@nic.cz>
Fri, 31 Oct 2025 09:57:27 +0000 (10:57 +0100)
Notice:
Both masters send their NOTIFY's to the slave. The slave makes
refresh from the last master which it received NOTIFY from
- it's the current state of Knot DNS design. If a NOTIFY
for lower serial arrives close enough after the previous NOTIFY
for a higher serial from another master, before the slave made
refresh from the first master, the first NOTIFY "knowledge" gets
"overwritten" by the second one with lower serial, resulting
in refresh from the lagging behind master and a rare test failure.

tests-extra/tests/ixfr/master_pin2/test.py

index a7deac6c7c0c4ebd44b3831cebee5a9207884016..cfc242180eb88a4d468e131108c9dda6ee55e0f7 100644 (file)
@@ -52,11 +52,26 @@ for m in [ masterA, masterB ]:
     m.dnssec(zones).enable = True
     m.conf_zone(zones).journal_content = "all"
 
+masterA.conf_zone(zones).notify_delay = "0"  # Disable even the small random value tests use.
+masterB.conf_zone(zones).notify_delay = "0"  #
 masterB.conf_zone(zones).serial_modulo = str(-PIN)
 
 t.start()
 
+ma_serials0 = masterA.zones_wait(zones)
+mb_serials0 = masterB.zones_wait(zones)
+slave.zones_wait(zones)
+
+# Align the masters before the testing starts.
+slave.ctl("zone-freeze", wait=True)
 serials0 = slave.zones_wait(zones)
+masterA.ctl("zone-sign")
+masterB.ctl("zone-sign")
+masterA.zones_wait(zones, ma_serials0)
+masterB.zones_wait(zones, mb_serials0)
+slave.ctl("zone-thaw")
+
+serials0 = slave.zones_wait(zones, serials0)
 
 for m in [ masterA, masterB ]:
     up = m.update(zone)
@@ -79,6 +94,7 @@ masterA.ctl("zone-thaw")
 
 t.sleep(4)
 
+# May fail occasionally, for details see this commit's message.
 check_cur(masterA, masterB)
 
 RUNNING = False