Skip to content

Commit e9fc29d

Browse files
committed
Kill the QEMU process if it takes too long to exit
1 parent 818d5f5 commit e9fc29d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

uefi-test-runner/build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,13 @@ def run_qemu():
224224
# Delete the screenshot once done
225225
os.remove('screenshot.ppm')
226226
finally:
227-
# Wait for QEMU to finish
228-
status = qemu.wait()
227+
try:
228+
# Wait for QEMU to finish
229+
status = qemu.wait(15)
230+
except sp.TimeoutExpired:
231+
print('Tests are taking too long to run, killing QEMU', file=sys.stderr)
232+
qemu.kill()
233+
status = -1
229234

230235
# Delete the monitor pipes
231236
os.remove(monitor_input_path)

0 commit comments

Comments
 (0)