]> code.ossystems Code Review - openembedded-core.git/commitdiff
selftest/context: Avoid tracebacks from tests using multiprocessing
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 19 Feb 2020 17:27:26 +0000 (17:27 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 21 Feb 2020 09:37:03 +0000 (09:37 +0000)
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>
meta/lib/oeqa/selftest/context.py

index c4eb5d614eba8281b29d68eeb520b92a2c0f58ea..3d3b19c6e80205b9260a86fd09d85dafe45d569d 100644 (file)
@@ -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