Fix test setup's timeout_multiplier handling.

pull/3168/merge
Hemmo Nieminen 7 years ago committed by Jussi Pakkanen
parent 3a4ac966d0
commit 275c737d57
  1. 6
      mesonbuild/mtest.py

@ -90,7 +90,7 @@ parser.add_argument('-v', '--verbose', default=False, action='store_true',
help='Do not redirect stdout and stderr') help='Do not redirect stdout and stderr')
parser.add_argument('-q', '--quiet', default=False, action='store_true', parser.add_argument('-q', '--quiet', default=False, action='store_true',
help='Produce less output to the terminal.') help='Produce less output to the terminal.')
parser.add_argument('-t', '--timeout-multiplier', type=float, default=1, parser.add_argument('-t', '--timeout-multiplier', type=float, default=None,
help='Define a multiplier for test timeout, for example ' help='Define a multiplier for test timeout, for example '
' when running tests in particular conditions they might take' ' when running tests in particular conditions they might take'
' more time to execute.') ' more time to execute.')
@ -303,8 +303,10 @@ class TestHarness:
kill_test = False kill_test = False
if test.timeout is None: if test.timeout is None:
timeout = None timeout = None
else: elif test_opts.timeout_multiplier is not None:
timeout = test.timeout * test_opts.timeout_multiplier timeout = test.timeout * test_opts.timeout_multiplier
else:
timeout = test.timeout
try: try:
(stdo, stde) = p.communicate(timeout=timeout) (stdo, stde) = p.communicate(timeout=timeout)
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:

Loading…
Cancel
Save