From: Peter van Dijk Date: Mon, 8 Apr 2019 12:06:22 +0000 (+0200) Subject: improve timer resolution X-Git-Tag: dnsdist-1.4.0-alpha1~13^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6c76ba3b896d20c04f6ad8a9af76f67a1d8720d;p=pdns improve timer resolution --- diff --git a/regression-tests.dnsdist/test_TCPLimits.py b/regression-tests.dnsdist/test_TCPLimits.py index 7652347d0..010c1c68b 100644 --- a/regression-tests.dnsdist/test_TCPLimits.py +++ b/regression-tests.dnsdist/test_TCPLimits.py @@ -106,11 +106,11 @@ class TestTCPLimits(DNSDistTest): conn.send(struct.pack("!H", 65535)) count = 0 - while count < (self._maxTCPConnDuration * 2): + while count < (self._maxTCPConnDuration * 20): try: # sleeping for only one second keeps us below the # idle timeout (setTCPRecvTimeout()) - time.sleep(1) + time.sleep(0.5) conn.send(b'A') count = count + 1 except Exception as e: @@ -119,7 +119,7 @@ class TestTCPLimits(DNSDistTest): end = time.time() - self.assertAlmostEquals(count, self._maxTCPConnDuration, delta=2) + self.assertAlmostEquals(count / 10, self._maxTCPConnDuration, delta=2) self.assertAlmostEquals(end - start, self._maxTCPConnDuration, delta=2) conn.close()