[oe-commits] [bitbake] branch master-next updated: tests/runqueue: Fix hashserve shutdown race

git at git.openembedded.org git at git.openembedded.org
Wed Oct 2 09:29:28 UTC 2019


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

rpurdie pushed a commit to branch master-next
in repository bitbake.

The following commit(s) were added to refs/heads/master-next by this push:
     new f919109  tests/runqueue: Fix hashserve shutdown race
f919109 is described below

commit f91910995bb35f88376c21c58f124322c2e43cd3
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Wed Oct 2 10:14:24 2019 +0100

    tests/runqueue: Fix hashserve shutdown race
    
    The hashserve can delete its socket whilst the cleanup us happening leading to
    backtraces and test failures.
    
    Add code to avoid this race condition.
    
    [YOCTO #13542]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/tests/runqueue.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/bb/tests/runqueue.py b/lib/bb/tests/runqueue.py
index 50b3392..5e64391 100644
--- a/lib/bb/tests/runqueue.py
+++ b/lib/bb/tests/runqueue.py
@@ -12,6 +12,7 @@ import os
 import tempfile
 import subprocess
 import sys
+import time
 
 #
 # TODO:
@@ -257,6 +258,8 @@ class RunQueueTests(unittest.TestCase):
                         'a1:package_write_ipk_setscene', 'a1:package_qa_setscene']
             self.assertEqual(set(tasks), set(expected))
 
+            self.shutdown(tempdir)
+
     @unittest.skipIf(sys.version_info < (3, 5, 0), 'Python 3.5 or later required')
     def test_hashserv_double(self):
         with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir:
@@ -280,6 +283,7 @@ class RunQueueTests(unittest.TestCase):
                         'a1:package_write_rpm_setscene', 'b1:package_write_ipk_setscene', 'a1:packagedata_setscene']
             self.assertEqual(set(tasks), set(expected))
 
+            self.shutdown(tempdir)
 
     @unittest.skipIf(sys.version_info < (3, 5, 0), 'Python 3.5 or later required')
     def test_hashserv_multiple_setscene(self):
@@ -309,3 +313,11 @@ class RunQueueTests(unittest.TestCase):
             for i in expected:
                 self.assertEqual(tasks.count(i), 1, "%s not in task list once" % i)
 
+            self.shutdown(tempdir)
+
+    def shutdown(self, tempdir):
+        # Wait for the hashserve socket to disappear else we'll see races with the tempdir cleanup
+        while os.path.exists(tempdir + "/hashserve.sock"):
+            time.sleep(0.5)
+
+

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


More information about the Openembedded-commits mailing list