toaster.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] toaster/test: Fixes warnings in autobuilder
@ 2023-12-08  1:57 Alassane Yattara
  0 siblings, 0 replies; only message in thread
From: Alassane Yattara @ 2023-12-08  1:57 UTC (permalink / raw)
  To: toaster; +Cc: Alassane Yattara

../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

Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
 lib/toaster/tests/commands/test_runbuilds.py       | 13 ++++++++++---
 lib/toaster/tests/functional/functional_helpers.py |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/toaster/tests/commands/test_runbuilds.py b/lib/toaster/tests/commands/test_runbuilds.py
index c77d6cf4..738d36e9 100644
--- a/lib/toaster/tests/commands/test_runbuilds.py
+++ b/lib/toaster/tests/commands/test_runbuilds.py
@@ -19,6 +19,10 @@ import time
 import subprocess
 import signal
 
+import logging
+
+
+logger = logging.getLogger("toaster")
 
 class KillRunbuilds(threading.Thread):
     """ Kill the runbuilds process after an amount of time """
@@ -34,9 +38,12 @@ class KillRunbuilds(threading.Thread):
         pidfile_path = os.path.join(os.environ.get("BUILDDIR", "."),
                                     ".runbuilds.pid")
 
-        with open(pidfile_path) as pidfile:
-            pid = pidfile.read()
-            os.kill(int(pid), signal.SIGTERM)
+        try:
+            with open(pidfile_path) as pidfile:
+                pid = pidfile.read()
+                os.kill(int(pid), signal.SIGTERM)
+        except ProcessLookupError:
+            logger.warning("Runbuilds not running or already killed")
 
 
 class TestCommands(TestCase):
diff --git a/lib/toaster/tests/functional/functional_helpers.py b/lib/toaster/tests/functional/functional_helpers.py
index b80d403b..1c535db6 100644
--- a/lib/toaster/tests/functional/functional_helpers.py
+++ b/lib/toaster/tests/functional/functional_helpers.py
@@ -62,7 +62,7 @@ class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
 
     def get_URL(self):
          rc=self.get_page_source()
-         project_url=re.search("(projectPageUrl\s:\s\")(.*)(\",)",rc)
+         project_url=re.search(r"(projectPageUrl\s:\s\")(.*)(\",)",rc)
          return project_url.group(2)
 
 
-- 
2.34.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-08  1:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-08  1:57 [PATCH] toaster/test: Fixes warnings in autobuilder Alassane Yattara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).