mirror of
https://git.yoctoproject.org/poky
synced 2026-04-02 17:02:21 +02:00
oeqa/selftest: recipetool/devtool: Avoid load_plugin test race
This bug has plagued the autobuilder for a couple of years and we've struggled to reproduce/debug it. The problem is the "lib" directory in meta-poky used during the load_plugin tests for recipetool and devtool can race and one can delete the files from the other leading to test failures. Deleting the lib directory only if empty will avoid this. [YOCTO #13070] (From OE-Core rev: d603e2fd589e1edbc67c8c2fefb6337e728b9d01) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -1500,7 +1500,11 @@ class DevtoolUpgradeTests(DevtoolBase):
|
||||
dstdir = os.path.join(dstdir, p)
|
||||
if not os.path.exists(dstdir):
|
||||
os.makedirs(dstdir)
|
||||
self.track_for_cleanup(dstdir)
|
||||
if p == "lib":
|
||||
# Can race with other tests
|
||||
self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir)
|
||||
else:
|
||||
self.track_for_cleanup(dstdir)
|
||||
dstfile = os.path.join(dstdir, os.path.basename(srcfile))
|
||||
if srcfile != dstfile:
|
||||
shutil.copy(srcfile, dstfile)
|
||||
|
||||
@@ -534,7 +534,11 @@ class RecipetoolTests(RecipetoolBase):
|
||||
dstdir = os.path.join(dstdir, p)
|
||||
if not os.path.exists(dstdir):
|
||||
os.makedirs(dstdir)
|
||||
self.track_for_cleanup(dstdir)
|
||||
if p == "lib":
|
||||
# Can race with other tests
|
||||
self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir)
|
||||
else:
|
||||
self.track_for_cleanup(dstdir)
|
||||
dstfile = os.path.join(dstdir, os.path.basename(srcfile))
|
||||
if srcfile != dstfile:
|
||||
shutil.copy(srcfile, dstfile)
|
||||
|
||||
Reference in New Issue
Block a user