Skip to content

Commit 4f190c9

Browse files
committed
Handle tests that just won't stop
1 parent 963a514 commit 4f190c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tests/run-tests.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,17 @@ def send_get(what):
183183

184184
# run the actual test
185185
try:
186-
output_mupy = subprocess.check_output(cmdlist, stderr=subprocess.STDOUT)
186+
result = subprocess.run(
187+
cmdlist,
188+
stderr=subprocess.STDOUT,
189+
stdout=subprocess.PIPE,
190+
check=True,
191+
timeout=10,
192+
)
193+
output_mupy = result.stdout
194+
except subprocess.TimeoutExpired as er:
195+
had_crash = True
196+
output_mupy = (er.output or b"") + b"TIMEOUT"
187197
except subprocess.CalledProcessError as er:
188198
had_crash = True
189199
output_mupy = er.output + b"CRASH"
@@ -869,7 +879,7 @@ def main():
869879
tests = args.files
870880

871881
if not args.keep_path:
872-
# clear search path to make sure tests use only builtin modules and those in extmod
882+
# clear search path to make sure tests use only builtin modules and those that can be frozen
873883
os.environ["MICROPYPATH"] = os.pathsep.join(
874884
[
875885
"",

0 commit comments

Comments
 (0)