mirror of https://github.com/fail2ban/fail2ban
increase max wait time a bit - some (systemd) tests may fail occasionally in fast mode
parent
cbc3cb431c
commit
9ecf6150c8
|
@ -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), 5)
|
self.assertEqual(unittest.F2B.maxWaitTime(25), 10)
|
||||||
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 if wtime < 10 else 5)
|
wtime = float(wtime) / 2.5
|
||||||
return wtime
|
return wtime
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue