]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 3 Jul 2020 10:37:20 +0000 (11:37 +0100)
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>
meta/lib/oeqa/selftest/cases/devtool.py
meta/lib/oeqa/selftest/cases/recipetool.py

index 7d8f89504592ac3122895111672bdf6ca41ebc87..b383ed9c50b154a208f9c6dc0a667c3414bba096 100644 (file)
@@ -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)
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)