diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-01 23:07:01 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-10-06 17:01:10 +0100 |
| commit | be4c6e94efc0aa22cb2e9ba31f2ba0d3092d7390 (patch) | |
| tree | e212d4c6f738c7e2ba4ce389816cb2be552a2678 /meta/lib/oeqa/selftest/context.py | |
| parent | b77b6348919a8da678bb5c2c7888d4e5f12b48ad (diff) | |
| download | poky-be4c6e94efc0aa22cb2e9ba31f2ba0d3092d7390.tar.gz | |
oeqa/selftest: Fix single threaded race issue
(From OE-Core rev: a3c8b9240a6e24e12eb2b43b48d1b0904e45afc7)
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.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 16f82c6737..c9eb481725 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
| @@ -44,9 +44,13 @@ class NonConcurrentTestSuite(unittest.TestSuite): | |||
| 44 | self.bb_vars = bb_vars | 44 | self.bb_vars = bb_vars |
| 45 | 45 | ||
| 46 | def run(self, result): | 46 | def run(self, result): |
| 47 | origenv = os.environ.copy() | ||
| 47 | (builddir, newbuilddir) = self.setupfunc("-st", None, self.suite) | 48 | (builddir, newbuilddir) = self.setupfunc("-st", None, self.suite) |
| 48 | ret = super().run(result) | 49 | ret = super().run(result) |
| 50 | # In forks we don't have to restore but in a single process, restore cwd and the env | ||
| 49 | os.chdir(builddir) | 51 | os.chdir(builddir) |
| 52 | for e in origenv: | ||
| 53 | os.environ[e] = origenv[e] | ||
| 50 | if newbuilddir and ret.wasSuccessful() and self.removefunc: | 54 | if newbuilddir and ret.wasSuccessful() and self.removefunc: |
| 51 | self.removefunc(newbuilddir) | 55 | self.removefunc(newbuilddir) |
| 52 | 56 | ||
