Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mikko Rapeli <mikko.rapeli@linaro.org>
To: openembedded-core@lists.openembedded.org
Cc: Mikko Rapeli <mikko.rapeli@linaro.org>
Subject: [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake
Date: Fri, 21 Nov 2025 12:59:51 +0200	[thread overview]
Message-ID: <20251121105951.1158626-1-mikko.rapeli@linaro.org> (raw)

When testexport.bbclass is used, then build environment and bitbake
may not be available when oeqa tests run.

Fixes oeqa test execution:

https://ledge.validation.linaro.org/scheduler/job/123974

ImportError: Failed to import test module: apt
Traceback (most recent call last):
  File "/usr/lib/python3.13/unittest/loader.py", line 396, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.13/unittest/loader.py", line 339, in _get_module_from_name
    __import__(name)
    ~~~~~~~~~~^^^^^^
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/runtime/cases/apt.py", line 8, in <module>
    from oeqa.utils.httpserver import HTTPService
  File "/lava-downloads/core-image-sato/meta/lib/oeqa/utils/httpserver.py", line 9, in <module>
    from bb import multiprocessing
ModuleNotFoundError: No module named 'bb'

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/lib/oeqa/utils/httpserver.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/httpserver.py b/meta/lib/oeqa/utils/httpserver.py
index 9e61cd89d5..cd42d3ed4c 100644
--- a/meta/lib/oeqa/utils/httpserver.py
+++ b/meta/lib/oeqa/utils/httpserver.py
@@ -6,7 +6,10 @@
 
 import http.server
 import logging
-from bb import multiprocessing
+try:
+    from bb import multiprocessing
+except ImportError:
+    import multiprocessing
 import os
 import signal
 from socketserver import ThreadingMixIn
-- 
2.34.1



             reply	other threads:[~2025-11-21 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-21 10:59 Mikko Rapeli [this message]
2025-11-21 13:27 ` [OE-core] [PATCH] oeqa httpserver.py: fallback for multiprocessing import without bitbake Richard Purdie
2025-11-21 13:30   ` Mikko Rapeli
2025-11-21 13:34     ` Richard Purdie
2025-11-21 13:39       ` Mikko Rapeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251121105951.1158626-1-mikko.rapeli@linaro.org \
    --to=mikko.rapeli@linaro.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox