diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py index afa6162e..86ffdb46 100644 --- a/fail2ban/tests/servertestcase.py +++ b/fail2ban/tests/servertestcase.py @@ -168,9 +168,9 @@ class Transmitter(TransmitterBase): t0 = time.time() self.assertEqual(self.transm.proceed(["sleep", "1"]), (0, None)) t1 = time.time() - # Approx 1 second delay - self.assertGreater(t1 - t0, 0.99) # shouldn't be faster than 1sec - self.assertGreater(1.1, t1 - t0) + # Approx 1 second delay but not faster + dt = t1 - t0 + self.assertTrue(0.99 < dt < 1.1, msg="Sleep was %g sec" % dt) def testDatabase(self): tmp, tmpFilename = tempfile.mkstemp(".db", "fail2ban_")