From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 13 Nov 2025 15:04:54 +0000 (-0500) Subject: Declare variable outside loop to clarify that its use extends beyond loop X-Git-Tag: rec-5.4.0-alpha1~81^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4eadbfda046d6e141131f590463c4944fcd0bb4c;p=thirdparty%2Fpdns.git Declare variable outside loop to clarify that its use extends beyond loop Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- diff --git a/regression-tests.dnsdist/test_HealthChecks.py b/regression-tests.dnsdist/test_HealthChecks.py index 4e74281bb8..5a4e958e54 100644 --- a/regression-tests.dnsdist/test_HealthChecks.py +++ b/regression-tests.dnsdist/test_HealthChecks.py @@ -471,9 +471,11 @@ class TestUpdateHCParamsCombo1(HealthCheckUpdateParams): self.setDrop() # wait for 1st failure - for i in [1,2,3]: + i = 1 + while i <= 3: rc = self.wait1() if rc is False: break + i += 1 self.assertGreater(3, i) time.sleep(1.1) # should have failures but still up @@ -490,9 +492,11 @@ class TestUpdateHCParamsCombo1(HealthCheckUpdateParams): self.setDrop(False) # wait for 1st success - for i in [1,2,3]: + i = 1 + while i <= 3: rc = self.wait1() if rc is True: break + i += 1 self.assertGreater(3, i) time.sleep(0.1) # still down @@ -540,9 +544,11 @@ class TestUpdateHCParamsCombo2(HealthCheckUpdateParams): self.setDrop() # wait for 1st failure - for i in [1,2,3]: + i = 1 + while i <= 3: rc = self.wait1() if rc is False: break + i += 1 self.assertGreater(3, i) beforeFailure = self.getBackendMetric(0, 'healthCheckFailures')