diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-14 23:27:14 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-29 11:17:26 +0100 |
commit | 6af7e42820e8fd4e7e7924d7534a534d3708d11c (patch) | |
tree | 5d7d8efc680e6441b2fc9a6e55cb440730206071 /meta/lib/oeqa/selftest | |
parent | 095aa7adfddc727df9ee17e8866c1521260f80e4 (diff) | |
download | poky-6af7e42820e8fd4e7e7924d7534a534d3708d11c.tar.gz |
oeqa: Update cleanup code to wait for hashserv exit
We sometimes see exceptions from code seeing the hashserv DB files
being removed at directory cleanup time. Add a check to ensure the
hashserv has written the data base journal (and hence likely exited)
before cleaning up.
This will hopefully avoid errors like:
Traceback (most recent call last):
File "[...]/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 30, in test_libc
delay = delay - 1
File "/usr/lib/python3.6/tempfile.py", line 948, in __exit__
self.cleanup()
File "/usr/lib/python3.6/tempfile.py", line 952, in cleanup
_rmtree(self.name)
File "/usr/lib/python3.6/shutil.py", line 486, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.6/shutil.py", line 424, in _rmtree_safe_fd
_rmtree_safe_fd(dirfd, fullname, onerror)
File "/usr/lib/python3.6/shutil.py", line 444, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib/python3.6/shutil.py", line 442, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'hashserv.db-wal'
(From OE-Core rev: 635833734b4c61e453ca9843a9fb5cecf3eb1c97)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 0b07d9add687d78495176cda0f3011c10ffa4d4b)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/eSDK.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/eSDK.py b/meta/lib/oeqa/selftest/cases/eSDK.py index 862849af35..d0c402ba8a 100644 --- a/meta/lib/oeqa/selftest/cases/eSDK.py +++ b/meta/lib/oeqa/selftest/cases/eSDK.py | |||
@@ -100,7 +100,7 @@ SSTATE_MIRRORS = "file://.* file://%s/PATH" | |||
100 | @classmethod | 100 | @classmethod |
101 | def tearDownClass(cls): | 101 | def tearDownClass(cls): |
102 | for i in range(0, 10): | 102 | for i in range(0, 10): |
103 | if os.path.exists(os.path.join(cls.tmpdir_eSDKQA, 'bitbake.lock')): | 103 | if os.path.exists(os.path.join(cls.tmpdir_eSDKQA, 'bitbake.lock')) or os.path.exists(os.path.join(cls.tmpdir_eSDKQA, 'cache/hashserv.db-wal')): |
104 | time.sleep(1) | 104 | time.sleep(1) |
105 | else: | 105 | else: |
106 | break | 106 | break |
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 1659926975..78c7a467e2 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -39,7 +39,7 @@ class NonConcurrentTestSuite(unittest.TestSuite): | |||
39 | 39 | ||
40 | def removebuilddir(d): | 40 | def removebuilddir(d): |
41 | delay = 5 | 41 | delay = 5 |
42 | while delay and os.path.exists(d + "/bitbake.lock"): | 42 | while delay and (os.path.exists(d + "/bitbake.lock") or os.path.exists(d + "/cache/hashserv.db-wal")): |
43 | time.sleep(1) | 43 | time.sleep(1) |
44 | delay = delay - 1 | 44 | delay = delay - 1 |
45 | # Deleting these directories takes a lot of time, use autobuilder | 45 | # Deleting these directories takes a lot of time, use autobuilder |