diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-02 19:46:07 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2020-07-06 14:33:20 -1000 |
commit | a31c694be5267c004b691e6374cc800222f19940 (patch) | |
tree | 9bee43cd1efc7901c518b50f04353c161587c67b /meta/lib/oeqa | |
parent | 838646da741cda2059ee2bd64fd1e59980fbf945 (diff) | |
download | openembedded-core-contrib-a31c694be5267c004b691e6374cc800222f19940.tar.gz |
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]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d603e2fd589e1edbc67c8c2fefb6337e728b9d01)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 6 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 5886862d6c..5003f08c75 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1447,7 +1447,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) diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index 6bfe8f177f..c2ade2543a 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py @@ -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) |