Skip to content

Commit 7746785

Browse files
committed
tests/run-tests.py: Wait for soft reset if a target skips a test.
Commit 69c25ea made raising `SystemExit` do a soft reset (on bare-metal targets). This means that any test which is skipped by a target (by raising `SystemExit`) will trigger a soft reset on that target, and then it must execute its startup code, such as `boot.py`. If the timing is right, this startup code can be unintentionally interrupted by the test runner when preparing the next test, because the test runner enters the raw REPL again via a Ctrl-C Ctrl-A ctrl-D sequence (in `Pyboard.enter_raw_repl()`). When this happens (`boot.py` is interrupted) the target may not be set up correctly, and it may (in the case of stm32 boards) flash LEDs and take extra time, slowing down the test run. Fix this by explicitly waiting for the target to finish its soft reset when it skips a test. Signed-off-by: Damien George <damien@micropython.org>
1 parent 1223fa9 commit 7746785

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/run-tests.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,12 @@ def run_one_test(test_file):
824824
output_mupy = run_micropython(pyb, args, test_file, test_file_abspath)
825825

826826
if output_mupy == b"SKIP\n":
827+
if pyb is not None and hasattr(pyb, "read_until"):
828+
# Running on a target over a serial connection, and the target requested
829+
# to skip the test. It does this via a SystemExit which triggers a soft
830+
# reset. Wait for the soft reset to finish, so we don't interrupt the
831+
# start-up code (eg boot.py) when preparing to run the next test.
832+
pyb.read_until(1, b"raw REPL; CTRL-B to exit\r\n")
827833
print("skip ", test_file)
828834
skipped_tests.append(test_name)
829835
return

0 commit comments

Comments
 (0)
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