From: Mark Andrews Date: Tue, 20 Apr 2021 04:56:07 +0000 (+1000) Subject: Wait for named to start X-Git-Tag: v9.17.13~44^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d5870f9df858fb9cea24474aca30f3f1f35078c;p=thirdparty%2Fbind9.git Wait for named to start If we don't wait for named to finish starting, 'rndc stop' may fail due to the listen limit being reached in named leading to a false negative test --- diff --git a/bin/tests/system/shutdown/tests-shutdown.py b/bin/tests/system/shutdown/tests-shutdown.py index eaf8d3ab3b0..e1ed83f242a 100755 --- a/bin/tests/system/shutdown/tests-shutdown.py +++ b/bin/tests/system/shutdown/tests-shutdown.py @@ -168,7 +168,13 @@ def test_named_shutdown(named_port, control_port): # In both methods named should exit gracefully. for kill_method in ("rndc", "sigterm"): named_proc = launch_named() - time.sleep(2) + # wait for named to finish loading + for _ in range(10): + try: + resolver.query('version.bind', 'TXT', 'CH') + break + except (dns.resolver.NoNameservers, dns.exception.Timeout): + time.sleep(1) do_work(named_proc, resolver, rndc_cmd, kill_method, n_workers=12, n_queries=16)