tests/run-tests.py: Use TEST_TIMEOUT as timeout for bare-metal tests.

This parameter is already used for PC-based tests (eg unix and webassembly
ports), and it makes sense for it to be used for bare-metal ports as well.
That way the timeout is configurable for all targets.

Because this increases the default timeout from 10s to 30s, this fixes some
long-running tests that would previously fail due to a timeout such as
`thread/stress_aes.py` on ESP32.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2025-07-17 15:28:15 +10:00
parent cc774c3daf
commit 941b7e35ac

View File

@@ -15,7 +15,7 @@ from multiprocessing.pool import ThreadPool
import threading
import tempfile
# Maximum time to run a PC-based test, in seconds.
# Maximum time to run a single test, in seconds.
TEST_TIMEOUT = float(os.environ.get('MICROPY_TEST_TIMEOUT', 30))
# See stackoverflow.com/questions/2632199: __file__ nor sys.argv[0]
@@ -333,7 +333,7 @@ def run_script_on_remote_target(pyb, args, test_file, is_special):
try:
had_crash = False
pyb.enter_raw_repl()
output_mupy = pyb.exec_(script)
output_mupy = pyb.exec_(script, timeout=TEST_TIMEOUT)
except pyboard.PyboardError as e:
had_crash = True
if not is_special and e.args[0] == "exception":