Skip to content

Commit

Permalink
Raise an error and log it if test timeouts are set incorrectly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Islam Elkanov authored and ochaplashkin committed Jul 13, 2023
1 parent be693d1 commit d34ecb0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,20 @@ def __init__(self):

self.check()

self.check_timeouts()

Options._initialized = True

def check_timeouts(self) -> None:
default_time_offset = 10
if (self.args.no_output_timeout - self.args.test_timeout) < default_time_offset or \
(self.args.test_timeout - self.args.server_start_timeout) < default_time_offset:
color_stdout("Some timeouts are set incorrectly.\n"
"Change the value(s) so that --no-output-timeout is at least 10 seconds "
"longer than --test-timeout\nand --test-timeout is at least 10 seconds "
"longer than --server-start-timeout\n", schema='error')
exit(1)

def check(self):
"""Check the arguments for correctness."""
check_error = False
Expand Down

0 comments on commit d34ecb0

Please sign in to comment.