From cc774c3daf68f3e2e1e920d7728b3c07cf6da32e Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 17 Jul 2025 15:27:39 +1000 Subject: [PATCH 1/2] tools/pyboard.py: Add timeout argument to Pyboard.exec_/exec. Signed-off-by: Damien George --- tools/pyboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/pyboard.py b/tools/pyboard.py index 50ecd33b7ab2..4099de299b2c 100755 --- a/tools/pyboard.py +++ b/tools/pyboard.py @@ -530,8 +530,8 @@ def eval(self, expression, parse=False): return ret # In Python3, call as pyboard.exec(), see the setattr call below. - def exec_(self, command, data_consumer=None): - ret, ret_err = self.exec_raw(command, data_consumer=data_consumer) + def exec_(self, command, timeout=10, data_consumer=None): + ret, ret_err = self.exec_raw(command, timeout, data_consumer) if ret_err: raise PyboardError("exception", ret, ret_err) return ret From 941b7e35acd8bd7597ba6a6111cb8e94662094b5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 17 Jul 2025 15:28:15 +1000 Subject: [PATCH 2/2] 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 --- tests/run-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/run-tests.py b/tests/run-tests.py index e2e95884ab19..522027c1f3e5 100755 --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -15,7 +15,7 @@ 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": pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy