Handle tests that just won't stop
This commit is contained in:
parent
963a51487a
commit
4f190c9228
|
@ -183,7 +183,17 @@ def run_micropython(pyb, args, test_file, is_special=False):
|
||||||
|
|
||||||
# run the actual test
|
# run the actual test
|
||||||
try:
|
try:
|
||||||
output_mupy = subprocess.check_output(cmdlist, stderr=subprocess.STDOUT)
|
result = subprocess.run(
|
||||||
|
cmdlist,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
check=True,
|
||||||
|
timeout=10,
|
||||||
|
)
|
||||||
|
output_mupy = result.stdout
|
||||||
|
except subprocess.TimeoutExpired as er:
|
||||||
|
had_crash = True
|
||||||
|
output_mupy = (er.output or b"") + b"TIMEOUT"
|
||||||
except subprocess.CalledProcessError as er:
|
except subprocess.CalledProcessError as er:
|
||||||
had_crash = True
|
had_crash = True
|
||||||
output_mupy = er.output + b"CRASH"
|
output_mupy = er.output + b"CRASH"
|
||||||
|
@ -869,7 +879,7 @@ the last matching regex is used:
|
||||||
tests = args.files
|
tests = args.files
|
||||||
|
|
||||||
if not args.keep_path:
|
if not args.keep_path:
|
||||||
# clear search path to make sure tests use only builtin modules and those in extmod
|
# clear search path to make sure tests use only builtin modules and those that can be frozen
|
||||||
os.environ["MICROPYPATH"] = os.pathsep.join(
|
os.environ["MICROPYPATH"] = os.pathsep.join(
|
||||||
[
|
[
|
||||||
"",
|
"",
|
||||||
|
|
Loading…
Reference in New Issue