aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2025-07-15 15:30:17 +0100
committerThomas Huth <thuth@redhat.com>2025-07-21 07:58:57 +0200
commit069a2ce8a75c9b59a4d08d6d2da3b36bfc5af3f4 (patch)
tree93414b5aad539dfb44aad5af25e88d8352db182e
parent99c6e970a4a6cfd862c6bb0a363c28538436de13 (diff)
downloadqemu-069a2ce8a75c9b59a4d08d6d2da3b36bfc5af3f4.zip
qemu-069a2ce8a75c9b59a4d08d6d2da3b36bfc5af3f4.tar.gz
qemu-069a2ce8a75c9b59a4d08d6d2da3b36bfc5af3f4.tar.bz2
functional: ensure log handlers are closed
This avoids a resource leak warning from python when the log handler is garbage collected. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250715143023.1851000-9-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--tests/functional/qemu_test/testcase.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 2082c6f..71c7160 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -232,6 +232,7 @@ class QemuBaseTest(unittest.TestCase):
self.socketdir = None
self.machinelog.removeHandler(self._log_fh)
self.log.removeHandler(self._log_fh)
+ self._log_fh.close()
def main():
path = os.path.basename(sys.argv[0])[:-3]
@@ -399,4 +400,5 @@ class QemuSystemTest(QemuBaseTest):
for vm in self._vms.values():
vm.shutdown()
logging.getLogger('console').removeHandler(self._console_log_fh)
+ self._console_log_fh.close()
super().tearDown()