From ac4c58e8ceb4d8685c0060ba4e49180bd0e3eea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Thu, 17 Jun 2021 12:39:32 +0200 Subject: [PATCH] Increase timeout in the rndc deadlock test The timeout originally picked for "rndc status" invocations (2 seconds) in the test attempting to reproduce a deadlock caused by running multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands concurrently causes intermittent failures of the "addzone" system test in GitLab CI. Increase the timeout to 10 seconds to make such failures less probable. Adjust code comments accordingly. --- bin/tests/system/addzone/tests_rndc_deadlock.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/tests/system/addzone/tests_rndc_deadlock.py b/bin/tests/system/addzone/tests_rndc_deadlock.py index 4e1e1090ba..43318d38bb 100755 --- a/bin/tests/system/addzone/tests_rndc_deadlock.py +++ b/bin/tests/system/addzone/tests_rndc_deadlock.py @@ -17,7 +17,7 @@ import time def run_rndc(server, rndc_command): ''' - Send the specified 'rndc_command' to 'server' with a timeout of 2 seconds + Send the specified 'rndc_command' to 'server' with a timeout of 10 seconds ''' rndc = os.getenv('RNDC') port = os.getenv('CONTROLPORT') @@ -25,7 +25,7 @@ def run_rndc(server, rndc_command): cmdline = [rndc, '-c', '../common/rndc.conf', '-p', port, '-s', server] cmdline.extend(rndc_command) - subprocess.check_output(cmdline, stderr=subprocess.STDOUT, timeout=2) + subprocess.check_output(cmdline, stderr=subprocess.STDOUT, timeout=10) def rndc_loop(test_state, domain): @@ -73,8 +73,9 @@ def test_rndc_deadlock(): domain = 'example%d' % i executor.submit(rndc_loop, test_state, domain) - # Run "rndc status" in 1-second intervals for a maximum of 10 seconds. - # If any "rndc status" command fails, the loop will be interrupted. + # Run "rndc status" 10 times, with 1-second pauses between attempts. + # Each "rndc status" invocation has a timeout of 10 seconds. If any of + # them fails, the loop will be interrupted. server_is_responsive = True attempts = 10 while server_is_responsive and attempts > 0: