summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/context.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-19 17:27:26 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-21 09:37:03 +0000
commitd9c62ffac611310efd47ed6397d31dccb72fe868 (patch)
tree567b01d6c4419334aaf55e5858f4fc70d4fd8d52 /meta/lib/oeqa/selftest/context.py
parent712a634c61ebc7ebda2669daf21460394f6ac2cd (diff)
downloadopenembedded-core-contrib-d9c62ffac611310efd47ed6397d31dccb72fe868.tar.gz
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] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/context.py')
-rw-r--r--meta/lib/oeqa/selftest/context.py6
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