diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-19 17:27:26 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-21 09:39:00 +0000 |
commit | dba8c1d5ef0b574b7772d59e5992bfad8b7cca13 (patch) | |
tree | 3982963bbd8fff2f23bfe0b865fdbefbc020389b /meta | |
parent | fe4f4ac4da98822fe3e9f319d913455495ae71aa (diff) | |
download | poky-dba8c1d5ef0b574b7772d59e5992bfad8b7cca13.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]
(From OE-Core rev: d9c62ffac611310efd47ed6397d31dccb72fe868)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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): | |||
280 | return rc | 280 | return rc |
281 | 281 | ||
282 | def _signal_clean_handler(self, signum, frame): | 282 | def _signal_clean_handler(self, signum, frame): |
283 | sys.exit(1) | 283 | if self.ourpid == os.getpid(): |
284 | sys.exit(1) | ||
284 | 285 | ||
285 | def run(self, logger, args): | 286 | def run(self, logger, args): |
286 | self._process_args(logger, args) | 287 | self._process_args(logger, args) |
287 | 288 | ||
289 | # Setup a SIGTERM handler to allow restoration of files like local.conf and bblayers.conf | ||
290 | # but don't interfer with other processes | ||
291 | self.ourpid = os.getpid() | ||
288 | signal.signal(signal.SIGTERM, self._signal_clean_handler) | 292 | signal.signal(signal.SIGTERM, self._signal_clean_handler) |
289 | 293 | ||
290 | rc = None | 294 | rc = None |