mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
harden ede24 system test
There was a random failure of ede24 system test. While this is still a bit speculative, the two reasons were: - in the case of `test_ede24_noloaded` the test might attempt to early (before the zone actually transfered on the secondary server) to query ns2. - still in the case of `test_ede24_noloaded`, even after waiting for transfer succeed logs, if the CI machine is slow, the zone could be expired before the request checking the secondary zone works because the expiration time of the zone was very short (1s). Moving this expiration time to 3 seconds should be enough (while not making the test execution too much longer when waiting for the zone expiration). - in the case of `test_ede24_expired`, the zone expired flag is flipped and the log message is printed immediately after. However, it is possible that because the flag is set using a relaxed atomic operation, another thread process the query and gets the previous (non-expired) value of the flag. In order to workaround this, the test now also expects another log written after the zone expiration (stop timers) on the next UV tick.
This commit is contained in:
parent
0b93d5725b
commit
611a556a6c
2 changed files with 10 additions and 3 deletions
|
|
@ -14,7 +14,7 @@ foo.fr. IN SOA ns.foo.fr. op.foo.fr. (
|
|||
3 ; serial
|
||||
1 ; refresh
|
||||
1 ; retry
|
||||
1 ; expire
|
||||
3 ; expire
|
||||
60 ; minimum
|
||||
)
|
||||
foo.fr. NS ns.foo.fr.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,10 @@ def check_soa_servfail_ede24(edemsg):
|
|||
|
||||
|
||||
def test_ede24_noloaded(ns1, ns2):
|
||||
# Sanity check that everything works first
|
||||
# Sanity check that everything works first, once we're sure the foo.fr zone
|
||||
# has transfered to ns2.
|
||||
with ns2.watch_log_from_start() as watcher:
|
||||
watcher.wait_for_line("Transfer status: success")
|
||||
check_soa_noerror()
|
||||
|
||||
# Stop all servers, and we'll restart only ns2.
|
||||
|
|
@ -59,7 +62,11 @@ def test_ede24_expired(ns1, ns2):
|
|||
# Stop the primary and wait for expiration of the zone in the secondary.
|
||||
with ns2.watch_log_from_here() as watcher:
|
||||
ns1.stop()
|
||||
watcher.wait_for_line(" zone foo.fr/IN: expired")
|
||||
log_sequence = [
|
||||
" zone foo.fr/IN: expired",
|
||||
" zone foo.fr/IN: stop zone timer",
|
||||
]
|
||||
watcher.wait_for_sequence(log_sequence)
|
||||
|
||||
# ns2 can't answer anymore.
|
||||
check_soa_servfail_ede24("zone expired")
|
||||
|
|
|
|||
Loading…
Reference in a new issue