Skip to content

Commit 2489d5b

Browse files
author
Islam Elkanov
committed
Raise an error and log it if test timeouts are set incorrectly
Added logic that abort test run and logs an error message if condition is not met: no-output-timeout is at least 10 seconds longer than test-timeout and test-timeout is at least 10 seconds longer than server-start-timeout. Closes #250
1 parent a6405f1 commit 2489d5b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/options.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,20 @@ def __init__(self):
511511

512512
self.check()
513513

514+
self.check_timeouts()
515+
514516
Options._initialized = True
515517

518+
def check_timeouts(self) -> None:
519+
default_time_offset = 10
520+
if (self.args.no_output_timeout - self.args.test_timeout) < default_time_offset or \
521+
(self.args.test_timeout - self.args.server_start_timeout) < default_time_offset:
522+
color_stdout("Some timeouts are set incorrectly.\n"
523+
"Change the value(s) so that --no-output-timeout is at least 10 seconds "
524+
"longer than --test-timeout\nand --test-timeout is at least 10 seconds "
525+
"longer than --server-start-timeout\n", schema='error')
526+
exit(-1)
527+
516528
def check(self):
517529
"""Check the arguments for correctness."""
518530
check_error = False

0 commit comments

Comments
 (0)