Skip to contentSkip to conversation

oeqa/buildtools-cases: Allow bitbake time to shutdown

PATCH In review Richard Purdie 2 participants 2 messages Aug 31, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oeqa/buildtools-cases: Allow bitbake time to shutdown

bitbake may still be shutting down when the UI exists. Wait for the lock to disappear before trying to delete the directory to avoid errors.

Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/buildtools/build/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 23, in test_libc

    self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir))

File "/usr/lib64/python3.7/tempfile.py", line 807, in __exit__
self.cleanup()
File "/usr/lib64/python3.7/tempfile.py", line 811, in cleanup
_shutil.rmtree(self.name)
File "/usr/lib64/python3.7/shutil.py", line 494, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib64/python3.7/shutil.py", line 452, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib64/python3.7/shutil.py", line 450, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.sock'

---
 meta/lib/oeqa/sdk/buildtools-cases/build.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/lib/oeqa/sdk/buildtools-cases/build.py +8 -1
index 5a17ab98c6c..a69e4a2443f 100644
@@ -3,6 +3,7 @@
 #
 
 import os, tempfile
+import time
 from oeqa.sdk.case import OESDKTestCase
 from oeqa.utils.subprocesstweak import errors_have_output
 errors_have_output()
@@ -20,4 +21,10 @@ class BuildTests(OESDKTestCase):
                 conf.write('\n')
                 conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR'])
 
-            self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir))
+            try:
+                self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir))
+            finally:
+                delay = 10
+                while delay and os.path.exists(testdir + "/build//bitbake.lock"):
+                    time.sleep(1)
+                    delay = delay - 1
Signature · 1 line
2.32.0
#1 lore raw
Quoted 9 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of Richard Purdie
Sent: den 31 augusti 2021 15:16
To: [email protected]
Subject: [OE-core] [PATCH] oeqa/buildtools-cases: Allow bitbake time to shutdown

bitbake may still be shutting down when the UI exists. Wait for the lock

I assume you mean "exits" rather than "exists"?

//Peter

Quoted 55 lines

to disappear before trying to delete the directory to avoid errors.

Traceback (most recent call last):
File "/home/pokybuild/yocto-
worker/buildtools/build/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 23, in test_libc

    self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' %

(corebase, testdir))
File "/usr/lib64/python3.7/tempfile.py", line 807, in __exit__
self.cleanup()
File "/usr/lib64/python3.7/tempfile.py", line 811, in cleanup
_shutil.rmtree(self.name)
File "/usr/lib64/python3.7/shutil.py", line 494, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib64/python3.7/shutil.py", line 452, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib64/python3.7/shutil.py", line 450, in _rmtree_safe_fd
os.unlink(entry.name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.sock'

---
 meta/lib/oeqa/sdk/buildtools-cases/build.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/lib/oeqa/sdk/buildtools-cases/build.py +1 -1
index 5a17ab98c6c..a69e4a2443f 100644
@@ -3,6 +3,7 @@
 #
 
 import os, tempfile
+import time
 from oeqa.sdk.case import OESDKTestCase
 from oeqa.utils.subprocesstweak import errors_have_output
 errors_have_output()
@@ -20,4 +21,10 @@ class BuildTests(OESDKTestCase):
                 conf.write('\n')
                 conf.write('DL_DIR = "%s"\n' % self.td['DL_DIR'])
 
-            self._run('. %s/oe-init-build-env %s && bitbake virtual/libc'

% (corebase, testdir))

meta/lib/oeqa/sdk/buildtools-cases/build.py +2 -0
+            try:
+                self._run('. %s/oe-init-build-env %s && bitbake

virtual/libc' % (corebase, testdir))

meta/lib/oeqa/sdk/buildtools-cases/build.py +3 -0
+            finally:
+                delay = 10
+                while delay and os.path.exists(testdir +

"/build//bitbake.lock"):

meta/lib/oeqa/sdk/buildtools-cases/build.py +2 -1
+                    time.sleep(1)
+                    delay = delay - 1
--

2.32.0