diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-19 17:27:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-04 23:17:38 +0100 |
commit | 3b60ea0339d24f195c9537ae6e3e10b355278fed (patch) | |
tree | bb7ebd7ecbf3dce8f8eda31627e3789c5425d335 | |
parent | f29b31784ae836b0d7f6f62398814900550a0c87 (diff) | |
download | poky-3b60ea0339d24f195c9537ae6e3e10b355278fed.tar.gz poky-3b60ea0339d24f195c9537ae6e3e10b355278fed.tar.bz2 poky-3b60ea0339d24f195c9537ae6e3e10b355278fed.zip |
selftest/context: Avoid tracebacks from tests using multiprocessing
We can see tracebacks where the SIGTERM handler catches things
it shouldn't. Avoid exit(1) unless we're the process that
it was intended for.
[YOCTO #13664]
(From OE-Core rev: d9c62ffac611310efd47ed6397d31dccb72fe868)
(From OE-Core rev: 45b4bd7b4d30d81bdff0d471e8d97c2322ed2f75)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit dba8c1d5ef0b574b7772d59e5992bfad8b7cca13)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index c4eb5d614e..3d3b19c6e8 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py @@ -280,11 +280,15 @@ class OESelftestTestContextExecutor(OETestContextExecutor): return rc def _signal_clean_handler(self, signum, frame): - sys.exit(1) + if self.ourpid == os.getpid(): + sys.exit(1) def run(self, logger, args): self._process_args(logger, args) + # Setup a SIGTERM handler to allow restoration of files like local.conf and bblayers.conf + # but don't interfer with other processes + self.ourpid = os.getpid() signal.signal(signal.SIGTERM, self._signal_clean_handler) rc = None |