summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-02 19:46:07 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-07 23:15:10 +0100
commit587a5de39786af621882b32be2b230cff23770ef (patch)
treeed8c8dad7d8f86a4451392855f06add1e752eb8b /meta/lib
parent9d2c1eef7b2dcace5b41edf0143c5a441c838a83 (diff)
downloadpoky-587a5de39786af621882b32be2b230cff23770ef.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] (From OE-Core rev: a31c694be5267c004b691e6374cc800222f19940) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d603e2fd589e1edbc67c8c2fefb6337e728b9d01) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/devtool.py6
-rw-r--r--meta/lib/oeqa/selftest/cases/recipetool.py6
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):
1447 dstdir = os.path.join(dstdir, p) 1447 dstdir = os.path.join(dstdir, p)
1448 if not os.path.exists(dstdir): 1448 if not os.path.exists(dstdir):
1449 os.makedirs(dstdir) 1449 os.makedirs(dstdir)
1450 self.track_for_cleanup(dstdir) 1450 if p == "lib":
1451 # Can race with other tests
1452 self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir)
1453 else:
1454 self.track_for_cleanup(dstdir)
1451 dstfile = os.path.join(dstdir, os.path.basename(srcfile)) 1455 dstfile = os.path.join(dstdir, os.path.basename(srcfile))
1452 if srcfile != dstfile: 1456 if srcfile != dstfile:
1453 shutil.copy(srcfile, dstfile) 1457 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):
534 dstdir = os.path.join(dstdir, p) 534 dstdir = os.path.join(dstdir, p)
535 if not os.path.exists(dstdir): 535 if not os.path.exists(dstdir):
536 os.makedirs(dstdir) 536 os.makedirs(dstdir)
537 self.track_for_cleanup(dstdir) 537 if p == "lib":
538 # Can race with other tests
539 self.add_command_to_tearDown('rmdir --ignore-fail-on-non-empty %s' % dstdir)
540 else:
541 self.track_for_cleanup(dstdir)
538 dstfile = os.path.join(dstdir, os.path.basename(srcfile)) 542 dstfile = os.path.join(dstdir, os.path.basename(srcfile))
539 if srcfile != dstfile: 543 if srcfile != dstfile:
540 shutil.copy(srcfile, dstfile) 544 shutil.copy(srcfile, dstfile)