From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v1] build: run the test suite in parallel
Date: Thu, 10 Sep 2026 12:44:12 -0400 [thread overview]
Message-ID: <20260910164412.1495535-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Both the unit tests and the functional tests were running serially,
which makes "make check" unnecessarily slow.
The automake test harness spawns the individual tests from a sub-make,
so adding -j to AM_MAKEFLAGS for the check-TESTS/recheck targets is
enough to parallelize the unit tests.
The functional tests are parallelized with pytest-xdist. The loadgroup
scheduler is required since pytest-bluezenv marks the tests sharing a
host/VM setup with an xdist_group, so that they are kept on the same
worker instead of each worker re-creating the same setup.
The number of concurrent tests defaults to nproc and can be overridden
with CHECK_JOBS, e.g. "make CHECK_JOBS=1 check" for a serial run.
Assisted-by: Claude:claude-opus-5
---
Makefile.am | 11 +++++++++++
test/functional/requirements.txt | 1 +
2 files changed, 12 insertions(+)
diff --git a/Makefile.am b/Makefile.am
index 3840bdbab17c..7164700ae896 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -859,8 +859,19 @@ endif
TESTS = $(unit_tests)
AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
+# Number of tests to run concurrently, override with e.g. CHECK_JOBS=1 to get
+# a serial run.
+CHECK_JOBS ?= $(shell nproc 2>/dev/null || echo 4)
+
+# The automake test harness spawns the individual tests from a sub-make, so
+# passing -j to it is enough to run the unit tests in parallel.
+check-TESTS recheck: AM_MAKEFLAGS += -j$(CHECK_JOBS)
+
+# The functional tests are parallelized by pytest-xdist, loadgroup is required
+# since pytest-bluezenv groups the tests sharing a host/VM setup together.
check-functional: all
python3 -m pytest "$(srcdir)/test/functional" -v \
+ -n $(CHECK_JOBS) --dist loadgroup \
-m "not tester" \
--kernel="$(FUNCTIONAL_TESTING_KERNEL)" \
--bluez-build-dir="$(top_builddir)" \
diff --git a/test/functional/requirements.txt b/test/functional/requirements.txt
index b8a1d99ee4d8..078c3fc6b656 100644
--- a/test/functional/requirements.txt
+++ b/test/functional/requirements.txt
@@ -1,3 +1,4 @@
pytest>=8
+pytest-xdist
pytest-bluezenv==0.1.9
black
--
2.55.0
next reply other threads:[~2026-09-10 16:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 16:44 Luiz Augusto von Dentz [this message]
2026-09-10 17:30 ` [PATCH BlueZ v1] build: run the test suite in parallel patchwork-bot+bluetooth
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=20260910164412.1495535-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.