From fffff999aaa01dfc841a82aa760f0c0a5f281fdb Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Wed, 6 Aug 2025 11:00:01 +0200 Subject: [PATCH] basic-test: more aggressively clean up the qemu instance --- basic-test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basic-test.py b/basic-test.py index d0ace54..797e7b4 100755 --- a/basic-test.py +++ b/basic-test.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL # SPDX-FileCopyrightText: 2025 Harald Sitter +import atexit import http.server import sys import subprocess @@ -53,6 +54,8 @@ qemu = subprocess.Popen([ "-bios", "/usr/share/OVMF/x64/OVMF.4m.fd", ]) +atexit.register(lambda: (qemu.kill())) + server.timeout = 5 * 60 # 5 minutes server.handle_timeout = lambda: (qemu.kill(), sys.exit(1)) while True: # kinda garbage but there seems to be no nice (non-private) poll-or-timeout api