mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 20:15:08 +00:00
tests: Fail tests immediately if they use too low wait/count values
This is for run_and_expect_type and run_and_expect topotests method. Some contributions unintentionally get merged with very low values, that leads to CI failures, let's guard this a bit. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
c90ff0c4db
commit
a5722d5a78
@ -355,6 +355,16 @@ def run_and_expect(func, what, count=20, wait=3):
|
|||||||
else:
|
else:
|
||||||
func_name = func.__name__
|
func_name = func.__name__
|
||||||
|
|
||||||
|
# Just a safety-check to avoid running topotests with very
|
||||||
|
# small wait/count arguments.
|
||||||
|
wait_time = wait * count
|
||||||
|
if wait_time < 5:
|
||||||
|
assert (
|
||||||
|
wait_time >= 5
|
||||||
|
), "Waiting time is too small (count={}, wait={}), adjust timer values".format(
|
||||||
|
count, wait
|
||||||
|
)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"'{}' polling started (interval {} secs, maximum {} tries)".format(
|
"'{}' polling started (interval {} secs, maximum {} tries)".format(
|
||||||
func_name, wait, count
|
func_name, wait, count
|
||||||
@ -402,6 +412,16 @@ def run_and_expect_type(func, etype, count=20, wait=3, avalue=None):
|
|||||||
else:
|
else:
|
||||||
func_name = func.__name__
|
func_name = func.__name__
|
||||||
|
|
||||||
|
# Just a safety-check to avoid running topotests with very
|
||||||
|
# small wait/count arguments.
|
||||||
|
wait_time = wait * count
|
||||||
|
if wait_time < 5:
|
||||||
|
assert (
|
||||||
|
wait_time >= 5
|
||||||
|
), "Waiting time is too small (count={}, wait={}), adjust timer values".format(
|
||||||
|
count, wait
|
||||||
|
)
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"'{}' polling started (interval {} secs, maximum wait {} secs)".format(
|
"'{}' polling started (interval {} secs, maximum wait {} secs)".format(
|
||||||
func_name, wait, int(wait * count)
|
func_name, wait, int(wait * count)
|
||||||
|
Loading…
Reference in New Issue
Block a user