diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2019-01-24 17:33:01 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-24 17:45:25 +0000 |
commit | 15c54f56d697b00302b44d544eb597d169e75aef (patch) | |
tree | 326b270463328c30db6d94dad716723cfadc13d6 | |
parent | affe4ed77787ee1d80c9a761f365ec03a17d63fb (diff) | |
download | poky-15c54f56d697b00302b44d544eb597d169e75aef.tar.gz |
eSDK.py: avoid error in tearDownClass due to race condistion
When removing the temporary directory, it's possible that bitbake.lock
file is removed by bitbake during the cleanup. And this leads to the
following error.
FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.lock'
So add a check to remove this file before cleaning up the temporary
directory.
(From OE-Core rev: 984f56b37bd0014e5bf9509fc8ed181973e61773)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/eSDK.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/eSDK.py b/meta/lib/oeqa/selftest/cases/eSDK.py index d7aef93991..8e3a43d1c0 100644 --- a/meta/lib/oeqa/selftest/cases/eSDK.py +++ b/meta/lib/oeqa/selftest/cases/eSDK.py | |||
@@ -2,6 +2,7 @@ import tempfile | |||
2 | import shutil | 2 | import shutil |
3 | import os | 3 | import os |
4 | import glob | 4 | import glob |
5 | import time | ||
5 | from oeqa.core.decorator.oeid import OETestID | 6 | from oeqa.core.decorator.oeid import OETestID |
6 | from oeqa.selftest.case import OESelftestTestCase | 7 | from oeqa.selftest.case import OESelftestTestCase |
7 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars | 8 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars |
@@ -95,6 +96,11 @@ SSTATE_MIRRORS = "file://.* file://%s/PATH" | |||
95 | 96 | ||
96 | @classmethod | 97 | @classmethod |
97 | def tearDownClass(cls): | 98 | def tearDownClass(cls): |
99 | for i in range(0, 10): | ||
100 | if os.path.exists(os.path.join(cls.tmpdir_eSDKQA, 'bitbake.lock')): | ||
101 | time.sleep(1) | ||
102 | else: | ||
103 | break | ||
98 | cls.tmpdirobj.cleanup() | 104 | cls.tmpdirobj.cleanup() |
99 | super().tearDownClass() | 105 | super().tearDownClass() |
100 | 106 | ||