]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest: recipetool/devtool: Avoid load_plugin test race
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 Jul 2020 18:46:07 +0000 (19:46 +0100)
committerSteve Sakoman <steve@sakoman.com>
Tue, 7 Jul 2020 00:33:20 +0000 (14:33 -1000)
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>
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/recipetool.py

index 5886862d6c45a31c4e9d358a9ff42d93199c615b..5003f08c75f62557b753abb47904ca4a101ef6c8 100644 (file)
@@ -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)
index 6bfe8f177f26b94897506d3bac683248dd4790c7..c2ade2543a3ff1db804f6b9bfe9046e2d70ca76d 100644 (file)
@@ -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)