From e2782f7864362729417ca2810f33d67fe6d0e80d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 2 Dec 2016 09:58:56 -0300 Subject: tests: Allow user to change timeout time For example if we know the tests takes more time because, for example we are tracing it, or running with very high debug log level we might not want the test to timeout. --- mesontest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mesontest.py') diff --git a/mesontest.py b/mesontest.py index aaba053..cf10499 100755 --- a/mesontest.py +++ b/mesontest.py @@ -76,6 +76,10 @@ parser.add_argument('--num-processes', default=determine_worker_count(), type=in help='How many parallel processes to use.') parser.add_argument('-v', '--verbose', default=False, action='store_true', help='Do not redirect stdout and stderr') +parser.add_argument('-t', '--timeout-multiplier', type=float, default=1.0, + help='Define a multiplier for test timeout, for example ' + ' when running tests in particular conditions they might take' + ' more time to execute.') parser.add_argument('args', nargs='*') class TestRun(): @@ -199,7 +203,7 @@ class TestHarness: cwd=test.workdir, preexec_fn=setsid) timed_out = False - timeout = test.timeout if not self.options.gdb else None + timeout = test.timeout * self.options.timeout_multiplier try: (stdo, stde) = p.communicate(timeout=timeout) except subprocess.TimeoutExpired: -- cgit v1.1