mirror of https://github.com/fail2ban/fail2ban
test-suite: increase wait-time for fast-mode for long waiting intervals (stability, avoid sporadic errors)
parent
191d1e9533
commit
786d5b7e9e
|
@ -350,7 +350,7 @@ class TestsUtilsTest(LogCaptureTestCase):
|
||||||
unittest.F2B.fast = True
|
unittest.F2B.fast = True
|
||||||
try:
|
try:
|
||||||
self.assertEqual(unittest.F2B.maxWaitTime(lambda: 50)(), 50)
|
self.assertEqual(unittest.F2B.maxWaitTime(lambda: 50)(), 50)
|
||||||
self.assertEqual(unittest.F2B.maxWaitTime(25), 2.5)
|
self.assertEqual(unittest.F2B.maxWaitTime(25), 5)
|
||||||
self.assertEqual(unittest.F2B.maxWaitTime(25.), 25.0)
|
self.assertEqual(unittest.F2B.maxWaitTime(25.), 25.0)
|
||||||
finally:
|
finally:
|
||||||
unittest.F2B.fast = orgfast
|
unittest.F2B.fast = orgfast
|
||||||
|
|
|
@ -219,7 +219,7 @@ class F2B(DefaultTestOptions):
|
||||||
# short only integer interval (avoid by conditional wait with callable, and dual
|
# short only integer interval (avoid by conditional wait with callable, and dual
|
||||||
# wrapping in some routines, if it will be called twice):
|
# wrapping in some routines, if it will be called twice):
|
||||||
if self.fast and isinstance(wtime, int):
|
if self.fast and isinstance(wtime, int):
|
||||||
wtime = float(wtime) / 10
|
wtime = float(wtime) / (10 if wtime < 10 else 5)
|
||||||
return wtime
|
return wtime
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue