]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/cases/devtool.py: avoid .pyc race
authorTim Orling <timothy.t.orling@linux.intel.com>
Tue, 29 Sep 2020 04:49:05 +0000 (21:49 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 30 Sep 2020 14:01:47 +0000 (15:01 +0100)
In certain conditions, most likely under heavy load on the
AutoBuilder, the prebuilt .pyc files are attempting to be
executed before they have been completely copied. Avoid
this by not copying the .pyc files (nor the __pycache__
directory). The impact of python3-native recreating the .pyc
files should hopefully be negligible.

YOCTO#13421
YOCTO#13803

Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/devtool.py

index b383ed9c50b154a208f9c6dc0a667c3414bba096..a3d2e9ea7cc92f2bc69cc2e709ac8b011e761561 100644 (file)
@@ -56,7 +56,8 @@ def setUpModule():
                     if pth.startswith(canonical_layerpath):
                         if relpth.endswith('/'):
                             destdir = os.path.join(corecopydir, relpth)
-                            shutil.copytree(pth, destdir)
+                            # avoid race condition by not copying .pyc files YPBZ#13421,13803
+                            shutil.copytree(pth, destdir, ignore=ignore_patterns('*.pyc', '__pycache__'))
                         else:
                             destdir = os.path.join(corecopydir, os.path.dirname(relpth))
                             bb.utils.mkdirhier(destdir)