[oe-commits] [openembedded-core] 11/15: eSDK.py: avoid error in tearDownClass due to race condistion

git at git.openembedded.org git at git.openembedded.org
Thu Jan 24 17:46:45 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 984f56b37bd0014e5bf9509fc8ed181973e61773
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Thu Jan 24 17:33:01 2019 +0800

    eSDK.py: avoid error in tearDownClass due to race condistion
    When removing the temporary directory, it's possible that bitbake.lock
    file is removed by bitbake during the cleanup. And this leads to the
    following error.
      FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.lock'
    So add a check to remove this file before cleaning up the temporary
    Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/lib/oeqa/selftest/cases/eSDK.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/eSDK.py b/meta/lib/oeqa/selftest/cases/eSDK.py
index d7aef93..8e3a43d 100644
--- a/meta/lib/oeqa/selftest/cases/eSDK.py
+++ b/meta/lib/oeqa/selftest/cases/eSDK.py
@@ -2,6 +2,7 @@ import tempfile
 import shutil
 import os
 import glob
+import time
 from oeqa.core.decorator.oeid import OETestID
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
@@ -95,6 +96,11 @@ SSTATE_MIRRORS =  "file://.* file://%s/PATH"
     def tearDownClass(cls):
+        for i in range(0, 10):
+            if os.path.exists(os.path.join(cls.tmpdir_eSDKQA, 'bitbake.lock')):
+                time.sleep(1)
+            else:
+                break

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list