From b2f3d801b4ccaf7c4fa1f75769575bc8dfd99f4c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Fri, 12 Jul 2024 15:03:16 -0700 Subject: [PATCH] twister: pytest: use test timeout as the default base timeout The default base timeout for pytest is statically set by the TwisterHarnessConfig class to be 60 seconds. However, sometimes it takes longer than 60s before the app starts to run, especially on emulator/simulator where it takes quite some time to start. So pass the test timeout as the base timeout via pytest command line argument. Signed-off-by: Daniel Leung --- scripts/pylib/twister/twisterlib/harness.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/pylib/twister/twisterlib/harness.py b/scripts/pylib/twister/twisterlib/harness.py index 6c132a10d4e..37e56126289 100644 --- a/scripts/pylib/twister/twisterlib/harness.py +++ b/scripts/pylib/twister/twisterlib/harness.py @@ -383,6 +383,10 @@ class Pytest(Harness): '--log-cli-format=%(levelname)s: %(message)s' ]) + # Use the test timeout as the base timeout for pytest + base_timeout = handler.get_test_timeout() + command.append(f'--base-timeout={base_timeout}') + if handler.type_str == 'device': command.extend( self._generate_parameters_for_hardware(handler)