qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Stefan Hajnoczi" <stefanha@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PULL 2/5] functional: ensure log handlers are closed
Date: Mon, 21 Jul 2025 10:16:11 +0200	[thread overview]
Message-ID: <20250721081614.262563-3-thuth@redhat.com> (raw)
In-Reply-To: <20250721081614.262563-1-thuth@redhat.com>

From: Daniel P. Berrangé <berrange@redhat.com>

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>
---
 tests/functional/qemu_test/testcase.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 2082c6fce43..71c7160adcf 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -232,6 +232,7 @@ def tearDown(self):
             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 @@ def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
         logging.getLogger('console').removeHandler(self._console_log_fh)
+        self._console_log_fh.close()
         super().tearDown()
-- 
2.50.0



  parent reply	other threads:[~2025-07-21  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21  8:16 [PULL 0/5] Functional test patches and 32-bit arm Linux header removal Thomas Huth
2025-07-21  8:16 ` [PULL 1/5] linux-headers: Remove the 32-bit arm headers Thomas Huth
2025-07-21  8:16 ` Thomas Huth [this message]
2025-07-21  8:16 ` [PULL 3/5] functional: ensure sockets and files are closed Thomas Huth
2025-07-21  8:16 ` [PULL 4/5] functional: always enable all python warnings Thomas Huth
2025-07-21  8:16 ` [PULL 5/5] docs/devel: fix over-quoting of QEMU_TEST_KEEP_SCRATCH Thomas Huth
2025-07-21 13:59 ` [PULL 0/5] Functional test patches and 32-bit arm Linux header removal Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250721081614.262563-3-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).