public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH v1 0/3] Unit tests speed-up
@ 2026-01-09  9:28 Bastien Nocera
  2026-01-09  9:29 ` [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test Bastien Nocera
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Bastien Nocera @ 2026-01-09  9:28 UTC (permalink / raw)
  To: linux-bluetooth

With those small changes, as well as running tests concurrently using
meson, I was able to make the whole test suite run in less than 4
seconds on my desktop system, with a baseline of 50 seconds for "make
-j8 check" under the autotools.

make -j8 check: 50 seconds
meson before changes: 13 seconds
meson after changes: 3.6 seconds

Bastien Nocera (3):
  unit: Speed up unit-avdtp test
  unit: Speed up unit-gobex-transfer test
  unit: Speed up unit-ringbuf test

 unit/test-avdtp.c          | 2 +-
 unit/test-gobex-transfer.c | 2 +-
 unit/test-ringbuf.c        | 3 ---
 3 files changed, 2 insertions(+), 5 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test
  2026-01-09  9:28 [BlueZ PATCH v1 0/3] Unit tests speed-up Bastien Nocera
@ 2026-01-09  9:29 ` Bastien Nocera
  2026-01-09 10:26   ` Unit tests speed-up bluez.test.bot
  2026-01-09  9:29 ` [BlueZ PATCH v1 2/3] unit: Speed up unit-gobex-transfer test Bastien Nocera
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Bastien Nocera @ 2026-01-09  9:29 UTC (permalink / raw)
  To: linux-bluetooth

Speed up /TP/SIG/SMG/BI-02-C by reducing the timeout length from 1
second to 100 milliseconds.

This reduces the runtime from 1.5 secs to 0.1 secs.
---
 unit/test-avdtp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c
index 460982b2c542..9833b03be408 100644
--- a/unit/test-avdtp.c
+++ b/unit/test-avdtp.c
@@ -148,7 +148,7 @@ static gboolean send_pdu(gpointer user_data)
 	g_assert_cmpint(len, ==, pdu->size);
 
 	if (g_str_equal(context->data->test_name, "/TP/SIG/SMG/BI-02-C"))
-		g_timeout_add_seconds(1, context_quit, context);
+		g_timeout_add(100, context_quit, context);
 
 	if (pdu->fragmented)
 		return send_pdu(user_data);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [BlueZ PATCH v1 2/3] unit: Speed up unit-gobex-transfer test
  2026-01-09  9:28 [BlueZ PATCH v1 0/3] Unit tests speed-up Bastien Nocera
  2026-01-09  9:29 ` [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test Bastien Nocera
@ 2026-01-09  9:29 ` Bastien Nocera
  2026-01-09  9:29 ` [BlueZ PATCH v1 3/3] unit: Speed up unit-ringbuf test Bastien Nocera
  2026-01-09 22:40 ` [BlueZ PATCH v1 0/3] Unit tests speed-up patchwork-bot+bluetooth
  3 siblings, 0 replies; 7+ messages in thread
From: Bastien Nocera @ 2026-01-09  9:29 UTC (permalink / raw)
  To: linux-bluetooth

Speed up /gobex/test_packet_put_req_suspend_resume by reducing the
timeout length from seconds to hundreds of milliseconds.

This reduces the runtime from 1.5 secs to 0.1 secs.
---
 unit/test-gobex-transfer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unit/test-gobex-transfer.c b/unit/test-gobex-transfer.c
index 4fc97f4541b8..d97e0ae430f7 100644
--- a/unit/test-gobex-transfer.c
+++ b/unit/test-gobex-transfer.c
@@ -1123,7 +1123,7 @@ static gssize provide_seq_delay(void *buf, gsize len, gpointer user_data)
 
 	if (d->provide_delay > 0) {
 		g_obex_suspend(d->obex);
-		g_timeout_add_seconds(d->provide_delay, resume_obex, d);
+		g_timeout_add(d->provide_delay * 100, resume_obex, d);
 		d->provide_delay = 0;
 	}
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [BlueZ PATCH v1 3/3] unit: Speed up unit-ringbuf test
  2026-01-09  9:28 [BlueZ PATCH v1 0/3] Unit tests speed-up Bastien Nocera
  2026-01-09  9:29 ` [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test Bastien Nocera
  2026-01-09  9:29 ` [BlueZ PATCH v1 2/3] unit: Speed up unit-gobex-transfer test Bastien Nocera
@ 2026-01-09  9:29 ` Bastien Nocera
  2026-01-09 22:40 ` [BlueZ PATCH v1 0/3] Unit tests speed-up patchwork-bot+bluetooth
  3 siblings, 0 replies; 7+ messages in thread
From: Bastien Nocera @ 2026-01-09  9:29 UTC (permalink / raw)
  To: linux-bluetooth

Speed up /gobex/test_packet_put_req_suspend_resume by not printing
debug for each of the million of iterations of our test.

If we carry on printing this, then either the terminal's output speed,
or the debug capture from the test suite will throttle the test.

This reduces the runtime from 3.3 secs to 0.007 secs.
---
 unit/test-ringbuf.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/unit/test-ringbuf.c b/unit/test-ringbuf.c
index b1cf51115a41..0e348a49b8c9 100644
--- a/unit/test-ringbuf.c
+++ b/unit/test-ringbuf.c
@@ -57,9 +57,6 @@ static void test_power2(const void *data)
 		while (size3 < i && size3 < SIZE_MAX)
 			size3 <<= 1;
 
-		tester_debug("%zu -> size1=%zu size2=%zu size3=%zu\n",
-						i, size1, size2, size3);
-
 		g_assert(size1 == size2);
 		g_assert(size2 == size3);
 		g_assert(size3 == size1);
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* RE: Unit tests speed-up
  2026-01-09  9:29 ` [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test Bastien Nocera
@ 2026-01-09 10:26   ` bluez.test.bot
  2026-01-09 12:13     ` Bastien Nocera
  0 siblings, 1 reply; 7+ messages in thread
From: bluez.test.bot @ 2026-01-09 10:26 UTC (permalink / raw)
  To: linux-bluetooth, hadess

[-- Attachment #1: Type: text/plain, Size: 1261 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1040361

---Test result---

Test Summary:
CheckPatch                    PENDING   0.37 seconds
GitLint                       PENDING   0.40 seconds
BuildEll                      PASS      18.70 seconds
BluezMake                     PASS      633.86 seconds
MakeCheck                     PASS      18.63 seconds
MakeDistcheck                 PASS      217.16 seconds
CheckValgrind                 PASS      276.15 seconds
CheckSmatch                   PASS      309.87 seconds
bluezmakeextell               PASS      167.47 seconds
IncrementalBuild              PENDING   0.41 seconds
ScanBuild                     PASS      913.96 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Unit tests speed-up
  2026-01-09 10:26   ` Unit tests speed-up bluez.test.bot
@ 2026-01-09 12:13     ` Bastien Nocera
  0 siblings, 0 replies; 7+ messages in thread
From: Bastien Nocera @ 2026-01-09 12:13 UTC (permalink / raw)
  To: linux-bluetooth

FWIW,

Those are the speed-up results for the bot.

On Fri, 2026-01-09 at 02:26 -0800, bluez.test.bot@gmail.com wrote:
> 
<snip>
> MakeCheck                     PASS      18.63 seconds

vs. an earlier run:
> MakeCheck                     PASS      21.64 seconds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [BlueZ PATCH v1 0/3] Unit tests speed-up
  2026-01-09  9:28 [BlueZ PATCH v1 0/3] Unit tests speed-up Bastien Nocera
                   ` (2 preceding siblings ...)
  2026-01-09  9:29 ` [BlueZ PATCH v1 3/3] unit: Speed up unit-ringbuf test Bastien Nocera
@ 2026-01-09 22:40 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+bluetooth @ 2026-01-09 22:40 UTC (permalink / raw)
  To: Bastien Nocera; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Fri,  9 Jan 2026 10:28:59 +0100 you wrote:
> With those small changes, as well as running tests concurrently using
> meson, I was able to make the whole test suite run in less than 4
> seconds on my desktop system, with a baseline of 50 seconds for "make
> -j8 check" under the autotools.
> 
> make -j8 check: 50 seconds
> meson before changes: 13 seconds
> meson after changes: 3.6 seconds
> 
> [...]

Here is the summary with links:
  - [BlueZ,v1,1/3] unit: Speed up unit-avdtp test
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=51d93aca7afa
  - [BlueZ,v1,2/3] unit: Speed up unit-gobex-transfer test
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=027e29c34225
  - [BlueZ,v1,3/3] unit: Speed up unit-ringbuf test
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=00e5c016145a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-09 22:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-09  9:28 [BlueZ PATCH v1 0/3] Unit tests speed-up Bastien Nocera
2026-01-09  9:29 ` [BlueZ PATCH v1 1/3] unit: Speed up unit-avdtp test Bastien Nocera
2026-01-09 10:26   ` Unit tests speed-up bluez.test.bot
2026-01-09 12:13     ` Bastien Nocera
2026-01-09  9:29 ` [BlueZ PATCH v1 2/3] unit: Speed up unit-gobex-transfer test Bastien Nocera
2026-01-09  9:29 ` [BlueZ PATCH v1 3/3] unit: Speed up unit-ringbuf test Bastien Nocera
2026-01-09 22:40 ` [BlueZ PATCH v1 0/3] Unit tests speed-up patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox