summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/tests/commands/test_runbuilds.py
diff options
context:
space:
mode:
authorAlassane Yattara <alassane.yattara@savoirfairelinux.com>2023-12-08 02:56:33 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-08 17:17:42 +0000
commit6d91225651573ab19b81a4430bccfc85f05a8173 (patch)
treea78a20a27c5b83729735eafda5a6fd361c55b2fc /bitbake/lib/toaster/tests/commands/test_runbuilds.py
parent23d3e2c718d6eab5151a425e835554bd4fe20a8b (diff)
downloadpoky-6d91225651573ab19b81a4430bccfc85f05a8173.tar.gz
bitbake: toaster/tests: Fixes warnings in autobuilder
../bitbake/lib/toaster/tests/functional/functional_helpers.py:66 /home/pokybuild/yocto-worker/toaster/build/bitbake/lib/toaster/tests/functional/functional_helpers.py:66: DeprecationWarning: invalid escape sequence '\s' project_url=re.search("(projectPageUrl\s:\s\")(.*)(\",)",rc) Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/home/pokybuild/yocto-worker/toaster/build/bitbake/lib/toaster/tests/commands/test_runbuilds.py", line 39, in run os.kill(int(pid), signal.SIGTERM) ProcessLookupError: [Errno 3] No such process (Bitbake rev: 5a4732d5e4437cfc366c6b034868903ad6f0088c) Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/tests/commands/test_runbuilds.py')
-rw-r--r--bitbake/lib/toaster/tests/commands/test_runbuilds.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/tests/commands/test_runbuilds.py b/bitbake/lib/toaster/tests/commands/test_runbuilds.py
index c77d6cf490..738d36e98d 100644
--- a/bitbake/lib/toaster/tests/commands/test_runbuilds.py
+++ b/bitbake/lib/toaster/tests/commands/test_runbuilds.py
@@ -19,6 +19,10 @@ import time
19import subprocess 19import subprocess
20import signal 20import signal
21 21
22import logging
23
24
25logger = logging.getLogger("toaster")
22 26
23class KillRunbuilds(threading.Thread): 27class KillRunbuilds(threading.Thread):
24 """ Kill the runbuilds process after an amount of time """ 28 """ Kill the runbuilds process after an amount of time """
@@ -34,9 +38,12 @@ class KillRunbuilds(threading.Thread):
34 pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."), 38 pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
35 ".runbuilds.pid") 39 ".runbuilds.pid")
36 40
37 with open(pidfile_path) as pidfile: 41 try:
38 pid = pidfile.read() 42 with open(pidfile_path) as pidfile:
39 os.kill(int(pid), signal.SIGTERM) 43 pid = pidfile.read()
44 os.kill(int(pid), signal.SIGTERM)
45 except ProcessLookupError:
46 logger.warning("Runbuilds not running or already killed")
40 47
41 48
42class TestCommands(TestCase): 49class TestCommands(TestCase):