All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Anuj Mittal" <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [zeus][PATCH 02/25] targetcontrol: Fix leaking log handler
Date: Fri, 29 May 2020 13:52:38 +0800	[thread overview]
Message-ID: <6893eb741c4cd4849e2fde1f86d9911b6c89db5b.1590731377.git.anuj.mittal@intel.com> (raw)
In-Reply-To: <cover.1590731377.git.anuj.mittal@intel.com>

From: Richard Purdie <richard.purdie@linuxfoundation.org>

We had a mystery failure on the autobuilder where runqemu appeared to
be failing as a logfile directory no longer existed. The key to
reproducing was running a runqemu where the image was deleted (as
devtool does), then running another runqemu test. E.g.:

'oe-selftest -r  devtool.DevtoolExtractTests.test_devtool_deploy_target wic.Wic2.test_qemu_efi'

This then tries to write to the logfile from the first test, the
image directory was deleted and we get strange failures.

The fix is to remove the logging handler when qemu is stopped.

(From OE-Core rev: 924b020eacf111b4fd4d731b363084e254a3422d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9b335fa867805f612154ae92c5a1e727d3fb29ca)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/lib/oeqa/targetcontrol.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
index 1445e3ecfb..41557dc224 100644
--- a/meta/lib/oeqa/targetcontrol.py
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -117,9 +117,9 @@ class QemuTarget(BaseTarget):
         import oe.path
         bb.utils.mkdirhier(self.testdir)
         self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
-        loggerhandler = logging.FileHandler(self.qemurunnerlog)
-        loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
-        self.logger.addHandler(loggerhandler)
+        self.loggerhandler = logging.FileHandler(self.qemurunnerlog)
+        self.loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+        self.logger.addHandler(self.loggerhandler)
         oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
 
         if d.getVar("DISTRO") == "poky-tiny":
@@ -182,6 +182,7 @@ class QemuTarget(BaseTarget):
 
     def stop(self):
         self.runner.stop()
+        self.logger.removeHandler(self.loggerhandler)
         self.connection = None
         self.ip = None
         self.server_ip = None
-- 
2.25.4


  parent reply	other threads:[~2020-05-29  5:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  5:52 [zeus][PATCH 00/25] zeus review request Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 01/25] oeqa/qemurunner: Clean up failure handling Anuj Mittal
2020-05-29  5:52 ` Anuj Mittal [this message]
2020-05-29  5:52 ` [zeus][PATCH 03/25] python3: fix CVE-2020-8492 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 04/25] qemu: fix CVE-2020-11869 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 05/25] ghostscript : fix CVE-2019-10216 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 06/25] sstatesig: Optimise get_taskhash for hashequiv Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 07/25] glibc: CVE-2020-1752 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 08/25] wireless-regdb: Upgrade 2019.06.03 -> 2020.04.29 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 09/25] gstreamer1.0-python: add a patch to fix python 3.8 builds Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 10/25] gstreamer1.0: upgrade 1.16.1 -> 1.16.2 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 11/25] gstreamer1.0-plugins-base: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 12/25] gstreamer1.0-plugins-good: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 13/25] gstreamer1.0-plugins-bad: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 14/25] gstreamer1.0-plugins-ugly: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 15/25] gstreamer1.0-libav: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 16/25] gstreamer1.0-omx: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 17/25] gstreamer1.0-python: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 18/25] gstreamer1.0-rtsp-server: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 19/25] gstreamer1.0-vaapi: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 20/25] gst-validate: " Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 21/25] icu: update SRC_URI Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 22/25] bind: fix CVE-2020-8616/7 Anuj Mittal
2020-05-29  5:52 ` [zeus][PATCH 23/25] strace: fix failing ptests Anuj Mittal
2020-05-29  5:53 ` [zeus][PATCH 24/25] avahi: Don't advertise example services by default Anuj Mittal
2020-05-29  5:53 ` [zeus][PATCH 25/25] mesa: fix meson configure fix when 'dri' is excluded from PACKAGECONFIG Anuj Mittal

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=6893eb741c4cd4849e2fde1f86d9911b6c89db5b.1590731377.git.anuj.mittal@intel.com \
    --to=anuj.mittal@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.